Bug 1019684 - Turn an assert into a release mode crash instead. r=mjrosenb, a=sledru
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 12 Jun 2014 09:11:00 -0400
changeset 206973 c28fb44d72a99c7d6d3c9513a9709e6ba22d75e2
parent 206972 7f9dc9e74bc037100af05a0072f1f53855cef805
child 206974 f436868418ee20934dba0c19fb3457731d58a938
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjrosenb, sledru
bugs1019684
milestone32.0a2
Bug 1019684 - Turn an assert into a release mode crash instead. r=mjrosenb, a=sledru
js/src/jit/arm/Assembler-arm.cpp
js/src/jit/arm/Assembler-arm.h
--- a/js/src/jit/arm/Assembler-arm.cpp
+++ b/js/src/jit/arm/Assembler-arm.cpp
@@ -1856,17 +1856,17 @@ Assembler::as_b(Label *l, Condition c, b
 
     int32_t old;
     BufferOffset ret;
     if (l->used()) {
         old = l->offset();
         // This will currently throw an assertion if we couldn't actually
         // encode the offset of the branch.
         if (!BOffImm::isInRange(old)) {
-            m_buffer.bail();
+            m_buffer.fail_bail();
             return ret;
         }
         ret = as_b(BOffImm(old), c, isPatchable);
     } else {
         old = LabelBase::INVALID_OFFSET;
         BOffImm inv;
         ret = as_b(inv, c, isPatchable);
     }
@@ -1918,17 +1918,17 @@ Assembler::as_bl(Label *l, Condition c)
     int32_t old;
     BufferOffset ret;
     // See if the list was empty :(
     if (l->used()) {
         // This will currently throw an assertion if we couldn't actually
         // encode the offset of the branch.
         old = l->offset();
         if (!BOffImm::isInRange(old)) {
-            m_buffer.bail();
+            m_buffer.fail_bail();
             return ret;
         }
         ret = as_bl(BOffImm(old), c);
     } else {
         old = LabelBase::INVALID_OFFSET;
         BOffImm inv;
         ret = as_bl(inv, c);
     }
--- a/js/src/jit/arm/Assembler-arm.h
+++ b/js/src/jit/arm/Assembler-arm.h
@@ -979,17 +979,18 @@ class BOffImm
     int32_t decode() {
         return ((((int32_t)data) << 8) >> 6) + 8;
     }
 
     explicit BOffImm(int offset)
       : data ((offset - 8) >> 2 & 0x00ffffff)
     {
         JS_ASSERT((offset & 0x3) == 0);
-        JS_ASSERT(isInRange(offset));
+        if (!isInRange(offset))
+            CrashAtUnhandlableOOM("BOffImm");
     }
     static bool isInRange(int offset)
     {
         if ((offset - 8) < -33554432)
             return false;
         if ((offset - 8) > 33554428)
             return false;
         return true;