Closed Bug 349663 Opened 18 years ago Closed 18 years ago

Function with const and *= changes during uneval-eval round trip

Categories

(Core :: JavaScript Engine, defect)

PowerPC
All
defect
Not set
minor

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: jruderman, Assigned: brendan)

References

Details

(Keywords: testcase, verified1.8.1)

Attachments

(1 file)

> function() { const h; for(null; h *= ""; null) ; }
function () { const h; for (null; h * ""; null) { } }

> function () { const h; for (null; h * ""; null) { } }
function () { const h; for (null; h * 0; null) { } }

It would be nice if the "" became 0 the first time.  My fuzzer in bug 349611 depends on functions not changing during round-trips in order to find "real" bugs in the decompiler.
Attached patch fixSplinter Review
Easy patch to fold constants more thoroughly: the operands of assignment operators such as *=, and all operands of a chained expression of same precedence and left associativity (represented as a list to avoid binary tree space cost and recursive depth hazard).

/be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #235190 - Flags: review?(shaver)
Fixed on trunk.

Checking in jsparse.c;
/cvsroot/mozilla/js/src/jsparse.c,v  <--  jsparse.c
new revision: 3.210; previous revision: 3.209
done

/be
Blocks: js1.7
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: blocking1.8.1?
Resolution: --- → FIXED
Attachment #235190 - Flags: approval1.8.1?
Comment on attachment 235190 [details] [diff] [review]
fix

a=beltzner on behalf of the 181drivers
Attachment #235190 - Flags: approval1.8.1? → approval1.8.1+
Flags: blocking1.8.1? → blocking1.8.1+
Target Milestone: --- → mozilla1.8.1
Fixed on the 1.8 branch.

/be
Keywords: fixed1.8.1
Checking in regress-349663.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-349663.js,v  <--  regress-349663.js
initial revision: 1.1
Flags: in-testsuite+
verified fixed 1.8 20060827 windows/mac*/linux

note 1.8 passes with
expected: function () {     const h;     for (null; h * 0; null) {     } } 
actual: function () {     const h;     for (null; h * 0; null) {     } }

1.8.0.7 passes with
expected: function () {     const h;     for (null; ""; null) {     } } 
actual: function () {     const h;     for (null; ""; null) {     } }
OS: Mac OS X 10.4 → All
verified fixed 1.9 20060827 windows/mac*/linux
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: