WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
18671
SquirrelFish: continue inside switch fails
https://bugs.webkit.org/show_bug.cgi?id=18671
Summary
SquirrelFish: continue inside switch fails
Oliver Hunt
Reported
2008-04-21 15:46:13 PDT
Valid continue statements fail inside a switch statement while(1) { print("foo"); switch(1) { case 1: continue; } } The problem is that getJumpContext with an empty label will return the nearest JumpContext, but in the case of continue it needs to return the nearest JumpContext with a continue target.
Attachments
Proposed patch
(2.84 KB, patch)
2008-04-21 16:20 PDT
,
Cameron Zwarich (cpst)
oliver
: review+
Details
Formatted Diff
Diff
Revised proposed patch
(2.86 KB, patch)
2008-04-21 16:32 PDT
,
Cameron Zwarich (cpst)
oliver
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Cameron Zwarich (cpst)
Comment 1
2008-04-21 16:20:40 PDT
Created
attachment 20741
[details]
Proposed patch Here is a fix.
Oliver Hunt
Comment 2
2008-04-21 16:23:48 PDT
Comment on
attachment 20741
[details]
Proposed patch I'd prefer: + if (forContinue) { + for (int i = m_jumpContextStack.size() - 1; i >= 0; i--) { + JumpContext* scope = &m_jumpContextStack[i]; + if (scope->continueTarget) + return scope; + } + return 0; + } But other than that, r=me
Cameron Zwarich (cpst)
Comment 3
2008-04-21 16:32:04 PDT
Created
attachment 20742
[details]
Revised proposed patch Modified as per Oliver's suggestion.
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