Bug 1308383 - Part 3: Cleanup BytecodeEmitter::emitConditionalExpression. r=shu
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -8414,33 +8414,36 @@ BytecodeEmitter::emitConditionalExpressi
return false;
/* Jump around else, fixup the branch, emit else, fixup jump. */
JumpList jmp;
if (!emitJump(JSOP_GOTO, &jmp))
return false;
if (!emitJumpTargetAndPatch(beq))
return false;
+ if (!setSrcNoteOffset(noteIndex, 0, jmp.offset - beq.offset))
+ return false;
/*
* Because each branch pushes a single value, but our stack budgeting
* analysis ignores branches, we now have to adjust this->stackDepth to
* ignore the value pushed by the first branch. Execution will follow
* only one path, so we must decrement this->stackDepth.
*
* Failing to do this will foil code, such as let block code generation,
* which must use the stack depth to compute local stack indexes correctly.
*/
MOZ_ASSERT(stackDepth > 0);
stackDepth--;
if (!emitConditionallyExecutedTree(&conditional.elseExpression()))
return false;
if (!emitJumpTargetAndPatch(jmp))
return false;
- return setSrcNoteOffset(noteIndex, 0, jmp.offset - beq.offset);
+
+ return true;
}
bool
BytecodeEmitter::emitPropertyList(ParseNode* pn, MutableHandlePlainObject objp, PropListType type)
{
for (ParseNode* propdef = pn->pn_head; propdef; propdef = propdef->pn_next) {
if (!updateSourceCoordNotes(propdef->pn_pos.begin))
return false;