Fix breaks in do-while loops.
authorDavid Anderson <danderson@mozilla.com>
Wed, 18 May 2011 16:19:48 -0700
changeset 104798 4c2438684d08a68cf626037b6b80ce6aec11fff7
parent 104797 e39539c471e4c24d56c6d59440e0be34a347f226
child 104799 9e8dcc1310f0f425688df0c0e6d0b0be330f85a3
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
milestone6.0a1
Fix breaks in do-while loops.
js/src/ion/IonBuilder.cpp
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -634,31 +634,27 @@ IonBuilder::finalizeLoop(CFGState &state
 
     state.loop.successor = successor;
     return true;
 }
 
 IonBuilder::ControlStatus
 IonBuilder::processDoWhileEnd(CFGState &state)
 {
-    if (current || state.loop.breaks) {
-        state.loop.successor = newBlock(current, state.loop.exitpc);
-        if (!state.loop.successor)
-            return ControlStatus_Error;
-    }
-
     if (!processDeferredContinues(state))
         return ControlStatus_Error;
-    if (!finalizeLoop(state, current->pop()))
+    if (!finalizeLoop(state, NULL))
         return ControlStatus_Error;
 
-    JS_ASSERT(JSOp(*pc) == JSOP_IFNE || JSOp(*pc) == JSOP_IFNEX);
-    pc += js_CodeSpec[JSOp(*pc)].length;
     current = state.loop.successor;
-    return current ? ControlStatus_Joined : ControlStatus_Ended;
+    if (!current)
+        return ControlStatus_Ended;
+
+    pc = current->pc();
+    return ControlStatus_Joined;
 }
 
 IonBuilder::ControlStatus
 IonBuilder::processWhileCondEnd(CFGState &state)
 {
     JS_ASSERT(JSOp(*pc) == JSOP_IFNE || JSOp(*pc) == JSOP_IFNEX);
 
     // Balance the stack past the IFNE.