Bug 756918 - Fix aliased, empty destructuring let (r=waldo)
authorLuke Wagner <luke@mozilla.com>
Fri, 25 May 2012 11:44:38 +0200
changeset 94953 1c64ae5ff661baa0cd5284c4ca9763aadc4547f0
parent 94945 3f363fd3a7e5e64a6a654c4d5b401bf88af0e48b
child 94954 f15f13527d494b9d6c977838865e8b543b953244
push id22770
push userryanvm@gmail.com
push dateSat, 26 May 2012 12:07:39 +0000
treeherdermozilla-central@cd62c4b8f500 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs756918
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 756918 - Fix aliased, empty destructuring let (r=waldo)
js/src/frontend/BytecodeEmitter.cpp
js/src/jit-test/tests/basic/testBug756918.js
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -1028,16 +1028,17 @@ EmitEnterBlock(JSContext *cx, BytecodeEm
         return false;
 
     for (unsigned i = 0; i < blockObj->slotCount(); i++) {
         Definition *dn = blockObj->maybeDefinitionParseNode(i);
 
         /* Beware the empty destructuring dummy. */
         if (!dn) {
             JS_ASSERT(i + 1 <= blockObj->slotCount());
+            blockObj->setAliased(i, bce->sc->bindingsAccessedDynamically());
             continue;
         }
 
         JS_ASSERT(dn->isDefn());
         JS_ASSERT(unsigned(dn->frameSlot() + depthPlusFixed) < JS_BIT(16));
         dn->pn_cookie.set(dn->pn_cookie.level(), uint16_t(dn->frameSlot() + depthPlusFixed));
 #ifdef DEBUG
         for (ParseNode *pnu = dn->dn_uses; pnu; pnu = pnu->pn_link) {
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testBug756918.js
@@ -0,0 +1,6 @@
+// |jit-test| error:Error
+
+with({})
+  let([] = []) {
+    eval("throw new Error()");
+  }