Bug 1308383 - Part 3: Cleanup BytecodeEmitter::emitConditionalExpression. r=shu
authorTooru Fujisawa <arai_a@mac.com>
Tue, 01 Nov 2016 16:53:49 +0900
changeset 432243 f8649b3008e1bd588b48156a5496c7b761be311a
parent 432242 25fe60b5746b4a6ab6bcdea940c1520980915d36
child 432244 5f884840b536fb4ce6d09ccfddec74d2b3a9d314
push id34240
push userbmo:ttromey@mozilla.com
push dateTue, 01 Nov 2016 14:41:32 +0000
reviewersshu
bugs1308383
milestone52.0a1
Bug 1308383 - Part 3: Cleanup BytecodeEmitter::emitConditionalExpression. r=shu
js/src/frontend/BytecodeEmitter.cpp
--- 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;