Bug 1155474 - Consider the input to MThrowUninitializedLexical implicitly used. r=Waldo, a=sledru

This commit is contained in:
Shu-yu Guo
2015-04-28 01:44:22 -07:00
parent 9b3b2711f8
commit eeceafa73e
2 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
// |jit-test| error: ReferenceError
{
for (var i = 0; i < 100; i++)
a += i;
let a = 1;
}

View File

@@ -12473,8 +12473,12 @@ IonBuilder::addLexicalCheck(MDefinition* input)
// If we're guaranteed to not be JS_UNINITIALIZED_LEXICAL, no need to check.
MInstruction* lexicalCheck;
if (input->type() == MIRType_MagicUninitializedLexical)
if (input->type() == MIRType_MagicUninitializedLexical) {
// Mark the input as implicitly used so the JS_UNINITIALIZED_LEXICAL
// magic value will be preserved on bailout.
input->setImplicitlyUsedUnchecked();
lexicalCheck = MThrowUninitializedLexical::New(alloc());
}
else if (input->type() == MIRType_Value)
lexicalCheck = MLexicalCheck::New(alloc(), input);
else