Closed Bug 581223 Opened 15 years ago Closed 15 years ago

let blocks in loops behave differently when tracing JIT is enabled

Categories

(Core :: JavaScript Engine, defect)

1.9.2 Branch
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: wes, Unassigned)

Details

Attachments

(1 file)

Attached file Short test case
I was playing with let blocks and found some really wacky behaviour. When I made a let block inside a for(let loop, and tried to use the loop iterator inside this new let block, it works 2 or 3 times (usually 2) and then claims that the inner let variable is undefined. I've repro'd on x86/Leopard with an old build (May 2010) and a fairly recent Tracemonkey, and also on sparc. My sparc tracemonkey is at the revision right before fatvals landed. The test program I'm attaching should count from 0 to 9. When the JIT is disabled, it does. When the JIT is enabled, it counts to 0 and 1, and sometimes 2, before throwing 'j is not defined'.
Attachment #459632 - Attachment mime type: application/x-javascript → text/plain
blocking2.0: --- → ?
This bug is possibly related. It evidences the same behaviour, although in a much longer test case, of a closed-over value becoming undefined (JIT only): https://bugzilla.mozilla.org/show_bug.cgi?id=583757
I don't suppose the landing of the patch for bug 582766 has fixed this? It fixed some problems with tracing 'let'.
blocking2.0: ? → betaN+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: