Bug 1019684 - Turn an assert into a release mode crash instead. r=mjrosenb

This commit is contained in:
Brian Hackett 2014-06-12 09:11:00 -04:00
parent 17146d7b2e
commit 2ac0be8c53
2 changed files with 4 additions and 3 deletions

View File

@ -1861,7 +1861,7 @@ Assembler::as_b(Label *l, Condition c, bool isPatchable)
// 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);
@ -1923,7 +1923,7 @@ Assembler::as_bl(Label *l, Condition c)
// 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);

View File

@ -984,7 +984,8 @@ class BOffImm
: data ((offset - 8) >> 2 & 0x00ffffff)
{
JS_ASSERT((offset & 0x3) == 0);
JS_ASSERT(isInRange(offset));
if (!isInRange(offset))
CrashAtUnhandlableOOM("BOffImm");
}
static bool isInRange(int offset)
{