mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1326589 - Correct CacheIR issue with uninitialized let and GetGName. r=jandem
This commit is contained in:
parent
ce7d6df2ad
commit
4a85614b87
@ -0,0 +1,8 @@
|
||||
for (var i = 0; i < 12; i++) {
|
||||
try {
|
||||
// GetGName
|
||||
void x;
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
let x;
|
13
js/src/jit-test/tests/baseline/getname-uninitialized-let.js
Normal file
13
js/src/jit-test/tests/baseline/getname-uninitialized-let.js
Normal file
@ -0,0 +1,13 @@
|
||||
function f() {
|
||||
for (var i = 0; i < 12; i++) {
|
||||
try {
|
||||
eval("");
|
||||
|
||||
void x;
|
||||
} catch (e) { }
|
||||
}
|
||||
}
|
||||
|
||||
f();
|
||||
|
||||
let x;
|
@ -1218,6 +1218,10 @@ GetNameIRGenerator::tryAttachGlobalNameValue(ObjOperandId objId, HandleId id)
|
||||
if (!shape->hasDefaultGetter() || !shape->hasSlot())
|
||||
return false;
|
||||
|
||||
// This might still be an uninitialized lexical.
|
||||
if (holder->getSlot(shape->slot()).isMagic())
|
||||
return false;
|
||||
|
||||
// Instantiate this global property, for use during Ion compilation.
|
||||
if (IsIonEnabled(cx_))
|
||||
EnsureTrackPropertyTypes(cx_, holder, id);
|
||||
@ -1332,6 +1336,8 @@ GetNameIRGenerator::tryAttachEnvironmentName(ObjOperandId objId, HandleId id)
|
||||
holder = &env->as<NativeObject>();
|
||||
if (!IsCacheableGetPropReadSlotForIonOrCacheIR(holder, holder, shape))
|
||||
return false;
|
||||
if (holder->getSlot(shape->slot()).isMagic())
|
||||
return false;
|
||||
|
||||
ObjOperandId lastObjId = objId;
|
||||
env = env_;
|
||||
|
Loading…
Reference in New Issue
Block a user