git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d9fc7aa
)
refined switch fallthrough handling
author
kramm
<kramm>
Fri, 2 Jan 2009 19:51:50 +0000
(19:51 +0000)
committer
kramm
<kramm>
Fri, 2 Jan 2009 19:51:50 +0000
(19:51 +0000)
lib/as3/parser.y
patch
|
blob
|
history
diff --git
a/lib/as3/parser.y
b/lib/as3/parser.y
index
8c99eca
..
264d2c7
100644
(file)
--- a/
lib/as3/parser.y
+++ b/
lib/as3/parser.y
@@
-1399,7
+1399,9
@@
CASE: "case" CONSTANT ':' MAYBECODE {
$$ = code_append($$, $2.c);
code_t*j = $$ = abc_ifne($$, 0);
$$ = code_append($$, $4);
$$ = code_append($$, $2.c);
code_t*j = $$ = abc_ifne($$, 0);
$$ = code_append($$, $4);
- $$ = abc___continue__($$, "");
+ if($$->opcode != OPCODE___BREAK__) {
+ $$ = abc___fallthrough__($$, "");
+ }
code_t*e = $$ = abc_nop($$);
j->branch = e;
}
code_t*e = $$ = abc_nop($$);
j->branch = e;
}
@@
-1415,6
+1417,7
@@
SWITCH : T_SWITCH '(' {new_state();} E ')' '{' MAYBE_CASE_LIST '}' {
code_t*c = $$,*lastblock=0;
while(c) {
if(c->opcode == OPCODE_IFNE) {
code_t*c = $$,*lastblock=0;
while(c) {
if(c->opcode == OPCODE_IFNE) {
+ if(!c->next) syntaxerror("internal error in fallthrough handling");
lastblock=c->next;
} else if(c->opcode == OPCODE___CONTINUE__) {
if(lastblock) {
lastblock=c->next;
} else if(c->opcode == OPCODE___CONTINUE__) {
if(lastblock) {