Bug 1019684 - Turn an assert into a release mode crash instead. r=mjrosenb, a=1.3+
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 12 Jun 2014 09:11:00 -0400
changeset 171532 13402cda531af5a4d8b507e71d312b8ae3d016da
parent 171531 4afb49342d25278588398399bcaa10c399861729
child 171533 75ee2ac4083dc5848615527aea18d00c431aeab4
push id532
push userryanvm@gmail.com
push dateTue, 17 Jun 2014 15:34:49 +0000
reviewersmjrosenb, 1
bugs1019684
milestone28.0
Bug 1019684 - Turn an assert into a release mode crash instead. r=mjrosenb, a=1.3+
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
@@ -1861,17 +1861,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);
     }
@@ -1923,17 +1923,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
@@ -967,17 +967,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;