Use of let in let-scoped for loops shows assertion

VERIFIED FIXED in mozilla1.8.1beta2

Status

()

Core
JavaScript Engine
P1
normal
VERIFIED FIXED
12 years ago
12 years ago

People

(Reporter: nanto_vi (TOYAMA Nao), Assigned: mrbkap)

Tracking

({verified1.8.1})

Trunk
mozilla1.8.1beta2
verified1.8.1
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4

An assertion is shown when using let statements/expressions/declarations in let-scoped for/for...in/for-each...in loops and repeating more than one time.

Reproducible: Always

Steps to Reproduce:
js> var f = [];
js> for (let i = 0; i < 1; i++) f[i] = let (n = i) function () { return n; };
function () {
    return n;
}
js> for (let i = 0; i < 2; i++) f[i] = let (n = i) function () { return n; };


Actual Results:  
Assertion failure: OBJ_GET_PARENT(cx, obj) == fp->blockChain, at jsinterp.c:5959

Expected Results:  
No assetion is shown.
(Assignee)

Comment 1

12 years ago
Yes, quite. Patch forthcoming.

Nanto, so you know, we've given you canconfirm bugzilla privileges so you can start filing these bugs as NEW instead of UNCONFIRMED. These reports are really appreciated.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.8.1beta2
(Assignee)

Comment 2

12 years ago
Created attachment 230222 [details] [diff] [review]
Fix

The first time we went around the while loop, we captured the scope chain, so blockChain was null'd out. Brendan and I went through all of the uses of fp->blockChain and determined that this was actually the right "fix".
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #230222 - Flags: review?(brendan)

Updated

12 years ago
Attachment #230222 - Flags: review?(brendan) → review+
(Assignee)

Comment 3

12 years ago
Fix checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Comment on attachment 230222 [details] [diff] [review]
Fix

Assertion-only fix, should be automatically approved.

/be
Attachment #230222 - Flags: approval1.8.1?

Comment 5

12 years ago
Checking in regress-345542.js;
/cvsroot/mozilla/js/tests/js1_7/block/regress-345542.js,v  <--  regress-345542.js
initial revision: 1.1
Flags: in-testsuite+
Comment on attachment 230222 [details] [diff] [review]
Fix

a=drivers. Automatic approval given. :)
Attachment #230222 - Flags: approval1.8.1? → approval1.8.1+

Comment 7

12 years ago
verified fixed trunk 20060723 win/mac*/linux

mrbkap: Can you check this into 1.8 today? Thanks.
Status: RESOLVED → VERIFIED
(Assignee)

Comment 8

12 years ago
Fix checked into the 1.8 branch.
Keywords: fixed1.8.1

Comment 9

12 years ago
verified fixed 1.8.1 windows/mac(ppc|tel)/linux 20060728
Keywords: fixed1.8.1 → verified1.8.1
You need to log in before you can comment on or make changes to this bug.