diff --git a/extra/xulrunner/PKGBUILD b/extra/xulrunner/PKGBUILD
index 01c1cab8a..3e7434c44 100644
--- a/extra/xulrunner/PKGBUILD
+++ b/extra/xulrunner/PKGBUILD
@@ -4,6 +4,7 @@
 
 # ALARM: Kevin Mihelich
 #  - added --disable-elf-hack to mozconfig
+#  - patch to fix busted code
 
 highmem=1
 
@@ -19,13 +20,15 @@ url="http://wiki.mozilla.org/XUL:Xul_Runner"
 source=(ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$pkgver/source/xulrunner-$pkgver.source.tar.bz2
         mozconfig
         mozilla-pkgconfig.patch
-        shared-libs.patch)
+        shared-libs.patch
+        alarm.patch)
 options=('!emptydirs')
 replaces=('xulrunner-oss')
 sha256sums=('c3623bc243bd57c7267eacac658993f5f635f639235bea9ed8fce9b52e59be64'
             '1b2a674d175e017282e7ef968364582d70a6034a9e0e2c0220f90572f3806428'
             '23485d937035648add27a7657f6934dc5b295e886cdb0506eebd02a43d07f269'
-            'e2b4a00d14f4ba69c62b3f9ef9908263fbab179ba8004197cbc67edbd916fdf1')
+            'e2b4a00d14f4ba69c62b3f9ef9908263fbab179ba8004197cbc67edbd916fdf1'
+            '6297c56f197b07ca29b31b3d51dedb86ddd3b57c0651e75a45156e2062b048e0')
 
 prepare() {
   cd "$srcdir/mozilla-release"
@@ -34,6 +37,7 @@ prepare() {
   #fix libdir/sdkdir - fedora
   patch -Np1 -i ../mozilla-pkgconfig.patch
   patch -Np1 -i ../shared-libs.patch
+  patch -Np0 -i ../alarm.patch
 
   # WebRTC build tries to execute "python" and expects Python 2
   # Workaround taken from chromium PKGBUILD
diff --git a/extra/xulrunner/alarm.patch b/extra/xulrunner/alarm.patch
new file mode 100644
index 000000000..142bb7b38
--- /dev/null
+++ b/extra/xulrunner/alarm.patch
@@ -0,0 +1,11 @@
+--- js/src/ion/shared/IonAssemblerBufferWithConstantPools.h.orig	2013-06-21 16:17:35.029032287 -0500
++++ js/src/ion/shared/IonAssemblerBufferWithConstantPools.h	2013-06-21 16:18:05.842731689 -0500
+@@ -675,7 +675,7 @@
+         JS_ASSERT(perforatedNode != NULL);
+         if (numDumps >= (1<<logBasePoolInfo) && (numDumps & (numDumps-1)) == 0) {
+             // need to resize.
+-            poolInfo = static_cast<PoolInfo*>(realloc_(poolInfo, sizeof(PoolInfo) * numDumps,
++            poolInfo = static_cast<PoolInfo*>(this->realloc_(poolInfo, sizeof(PoolInfo) * numDumps,
+                                                        sizeof(PoolInfo) * numDumps * 2));
+             if (poolInfo == NULL) {
+                 this->fail_oom();