fixed bug in while(){continue};
authorkramm <kramm>
Fri, 2 Jan 2009 19:51:06 +0000 (19:51 +0000)
committerkramm <kramm>
Fri, 2 Jan 2009 19:51:06 +0000 (19:51 +0000)
lib/as3/parser.y

index 1364b0e..0c6cfc1 100644 (file)
@@ -1343,12 +1343,13 @@ WHILE : MAYBELABEL "while" '(' {new_state();} EXPRESSION ')' CODEBLOCK {
     code_t*myjmp = $$ = abc_jump($$, 0);
     code_t*loopstart = $$ = abc_label($$);
     $$ = code_append($$, $7);
-    myjmp->branch = $$ = abc_nop($$);
+    code_t*cont = $$ = abc_nop($$);
+    myjmp->branch = cont;
     $$ = code_append($$, $5.c);
     $$ = abc_iftrue($$, loopstart);
     code_t*out = $$ = abc_nop($$);
     breakjumpsto($$, $1, out);
-    continuejumpsto($$, $1, loopstart);
+    continuejumpsto($$, $1, cont);
 
     $$ = killvars($$);
     old_state();