| Summary: | IteratorClose should be called when jumping over the target for-of loop | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||||
| Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | benjamin, fpizlo, ggaren, mark.lam, rniwa | ||||||||||
| Priority: | P2 | ||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Attachments: |
|
||||||||||||
The patch is already submitted in https://bugs.webkit.org/show_bug.cgi?id=142575, I'll move it to here. Created attachment 249659 [details]
Patch
Created attachment 249660 [details]
Patch
Created attachment 249661 [details]
Patch
Created attachment 249743 [details]
Patch
Comment on attachment 249743 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=249743&action=review r=me > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2358 > + } else if (finallyContext.iterator) { This should be an else with an ASSERT. It shouldn't be possible to have a finally context without either a block of code or an iterator close. Comment on attachment 249743 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=249743&action=review Thank you for your review! I'll fix and land it. >> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2358 >> + } else if (finallyContext.iterator) { > > This should be an else with an ASSERT. It shouldn't be possible to have a finally context without either a block of code or an iterator close. You're right. Use else and ASSERT instead. Committed r182226: <http://trac.webkit.org/changeset/182226> |
When executing the following script, var iter = ...; outer: for (var i of array) { for (var j of iter) { break outer; } } iter.return should be called.