X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fparser.y;h=0c6cfc12b19a55bb02261bcb43553ad561c79151;hb=146ed4a58cdf5c2c786f20aace4d20afd5802ba5;hp=6e1c2be61fe1ade2862413d9e859b8058f7c8c44;hpb=3405ac69abe80846d5a85e5aa8922c1c04209716;p=swftools.git diff --git a/lib/as3/parser.y b/lib/as3/parser.y index 6e1c2be..0c6cfc1 100644 --- a/lib/as3/parser.y +++ b/lib/as3/parser.y @@ -876,7 +876,12 @@ static void endfunction(token_t*ns, int flags, enum yytokentype getset, char*nam } } check_code_for_break(body); - f->body->code = body; + + if(f->body) + f->body->code = body; + else //interface + if(body) + syntaxerror("interface methods can't have a method body"); old_state(); } @@ -1338,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();