WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 18736
SQUIRRELFISH: switch statements with no default have incorrect codegen
https://bugs.webkit.org/show_bug.cgi?id=18736
Summary
SQUIRRELFISH: switch statements with no default have incorrect codegen
Cameron Zwarich (cpst)
Reported
2008-04-25 00:22:45 PDT
If no conditions match, we should skip all the case clauses, but instead we fall through to the first. function f2(i) { switch (i) { case 0: case 1: return 1; case 2: return 2; } // with no default, control will fall through return 3; } [ 0] load tr0, 0(@k0) [ 3] stricteq tr0, tr0, lr1 [ 7] jtrue tr0, 21(->30) [ 10] load tr0, 1(@k1) [ 13] stricteq tr0, tr0, lr1 [ 17] jtrue tr0, 11(->30) [ 20] load tr0, 2(@k2) [ 23] stricteq tr0, tr0, lr1 [ 27] jtrue tr0, 6(->35) [ 30] load tr0, 1(@k1) [ 33] ret tr0 [ 35] load tr0, 2(@k2) [ 38] ret tr0 [ 40] load tr0, 3(@k3) [ 43] ret tr0 This affects the JavaScriptCore regression test js1_2/statements/switch2.js.
Attachments
Add attachment
proposed patch, testcase, etc.
Oliver Hunt
Comment 1
2008-04-25 01:31:19 PDT
Committed
r32547
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug