Bug 14897
Summary: | Decompilation of double negation fails and produces invalid or incorrect code | ||
---|---|---|---|
Product: | WebKit | Reporter: | Oliver Hunt <oliver> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | CLOSED FIXED | ||
Severity: | Normal | CC: | jruderman, oliver |
Priority: | P2 | Keywords: | InRadar |
Version: | 523.x (Safari 3) | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 13638 |
Oliver Hunt
> (function() { a - -b; } )
becomes
function() {a--b;}
and
- -b
becomes
--b
Which is also clearly wrong and bad, but *will* compile
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Oliver Hunt
> (function(){a + +b;}).toString()
function(){a++b;}
Which is also wrong.
Jesse Ruderman
FWIW, Mozilla had the same bug and fixed it by always decompiling negation as "- ". See https://bugzilla.mozilla.org/show_bug.cgi?id=346904 for details.
Sam Weinig
<rdar://problem/5394405>
Sam Weinig
Fix landed in r24924
Oliver Hunt
*** Bug 14892 has been marked as a duplicate of this bug. ***