Closed Bug 349489 Opened 19 years ago Closed 19 years ago

Incorrect decompilation for labeled useless statements

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: jruderman, Assigned: brendan)

Details

(Keywords: testcase, verified1.8.1, Whiteboard: [181approval pending])

Attachments

(1 file)

When a function contains a labeled useless statement, decompilation puts the label on the next statement (or no statement, if there is no next statement). > function() { L: 3; } function () { L: } > function() { L: } SyntaxError on line 1: syntax error > function() { L: 3; alert(5); } function () { L: alert(5); } Suggested fix: (1) Don't optimize away labeled useless statements, or (2) When optimizing away labeled useless statements, also remove the label.
Attached patch fixSplinter Review
mrbkap said r=him a few minutes ago. /be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #234830 - Flags: review+
Drivers, this is another easy/safe fix. I encouraged Jesse to fuzz JS at the statement level, and informed him about labeled statements and break to label (which were news to him, probably to others). Here comes the fuzz! Better late than never. /be
Flags: blocking1.8.1?
OS: Mac OS X 10.4 → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1
Comment on attachment 234830 [details] [diff] [review] fix See previous comment. Safe and small fix. /be
Attachment #234830 - Flags: approval1.8.1?
Fixed on trunk. /be
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Flags: blocking1.8.1? → blocking1.8.1+
Whiteboard: [181approval pending]
Checking in regress-349489.js; /cvsroot/mozilla/js/tests/js1_5/Regress/regress-349489.js,v <-- regress-349489.js initial revision: 1.1
Flags: in-testsuite+
Comment on attachment 234830 [details] [diff] [review] fix a=schrep for drivers - approving all [181approval pending] bugs now that tree is open.
Attachment #234830 - Flags: approval1.8.1? → approval1.8.1+
Fixed on the 1.8 branch. /be
Keywords: fixed1.8.1
verified fixed 1.8, 1.9 20060824 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: