Closed Bug 352415 Opened 18 years ago Closed 18 years ago

Labeled loop gets braces between label and loop, breaking continue-to-label

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: jruderman, Assigned: brendan)

References

Details

(Keywords: testcase, verified1.8.1)

Attachments

(1 file)

js> function() { L: for (let x;;) continue L }

function () {
    L: {
        for (let x;;) {
            continue L;
        }
    }
}

Giving that back to the compiler results in an "invalid continue" error -- L now refers to a block rather than a loop, and you can't continue to a block.
Sigh -- need to take more care with selecting SRC_LABELBRACE.  TOK_LEXICALSCOPE nodes are put around loops that contain let declarations, throwing off the patch for bug 352402.

/be
Assignee: general → brendan
Depends on: 352402
OS: Mac OS X 10.4 → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1
Status: NEW → ASSIGNED
Blocks: js1.7let
Attached patch fix to fixSplinter Review
I'd like to get this in to correct the labeled brace decompilation fix from bug 352402 for 1.8.1.  This is essentially a one line fix (to keep the braces only if the labeled lexical scope node has a block (TOK_LC) as its kid).

/be
Attachment #238157 - Flags: review?(mrbkap)
Attachment #238157 - Flags: approval1.8.1?
Attachment #238157 - Flags: review?(mrbkap) → review+
Fixed on trunk:

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

/be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Checking in regress-352415.js;
/cvsroot/mozilla/js/tests/js1_7/block/regress-352415.js,v  <--  regress-352415.js
initial revision: 1.1
done
Flags: in-testsuite+
Comment on attachment 238157 [details] [diff] [review]
fix to fix

a=mconnor on behalf of drivers for 1.8 branch checkin
Attachment #238157 - Flags: approval1.8.1? → approval1.8.1+
Fixed on the 1.8 branch.

/be
Keywords: fixed1.8.1
verified fixed 1.8 20060914 windows/linux, 1.9 20060914 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: