Bug 19027
| Summary: | SquirrelFish: Incorrect codegen for pre-increment | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Oliver Hunt <oliver> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Blocker | CC: | ggaren, mjs, zwarich |
| Priority: | P1 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac | ||
| OS: | OS X 10.5 | ||
| URL: | javascript:try {(valueThrower={valueOf:function(){throw "throw from valueOf"}}, function () { executedRHS = false; var result = 'PASS'; try { result = ++valueThrower; alert('FAIL: Did not throw exception') } catch (e) { if (result != 'PASS' && executedRHS) { alert('FAIL: "'+expr+'" threw exception, but modified assignment target and executed RHS'); } else if (result != 'PASS') { alert('FAIL: "'+expr+'" threw exception, but modified assignment target'); } else if (executedRHS) { alert('FAIL: "'+expr+'" threw exception, but executed right hand half of expression') } else { alert('PASS: handled correctly') } } })()}catch(e){alert("Shouldn't receive: "+e);} | ||
Oliver Hunt
This hideous URL results in bogus behaviour:
javascript:try {(valueThrower={valueOf:function(){throw "throw from valueOf"}}, function () { executedRHS = false; var result = 'PASS'; try { result = ++valueThrower; alert('FAIL: Did not throw exception') } catch (e) { if (result != 'PASS' && executedRHS) { alert('FAIL: "'+expr+'" threw exception, but modified assignment target and executed RHS'); } else if (result != 'PASS') { alert('FAIL: "'+expr+'" threw exception, but modified assignment target'); } else if (executedRHS) { alert('FAIL: "'+expr+'" threw exception, but executed right hand half of expression') } else { alert('PASS: handled correctly') } } })()}catch(e){alert("Shouldn't receive: "+e);}
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Oliver Hunt
M JavaScriptCore/ChangeLog
M JavaScriptCore/VM/CodeBlock.cpp
M JavaScriptCore/VM/CodeGenerator.cpp
M JavaScriptCore/VM/CodeGenerator.h
M JavaScriptCore/VM/Machine.cpp
M JavaScriptCore/VM/Opcode.h
M JavaScriptCore/kjs/nodes.cpp
M LayoutTests/ChangeLog
M LayoutTests/fast/js/exception-sequencing-expected.txt
M LayoutTests/fast/js/exception-sequencing.html
Committed r33432