Bug 847412 - Monitor result type after a direct eval from Ion code, r=jandem.

This commit is contained in:
Brian Hackett 2013-03-19 08:47:06 -06:00
parent c1883f3027
commit 9eb583de8e
2 changed files with 23 additions and 1 deletions

View File

@ -4469,7 +4469,10 @@ IonBuilder::jsop_eval(uint32_t argc)
MInstruction *ins = MCallDirectEval::New(scopeChain, string, thisValue);
current->add(ins);
current->push(ins);
return resumeAfter(ins);
types::StackTypeSet *barrier;
types::StackTypeSet *types = oracle->returnTypeSet(script(), pc, &barrier);
return resumeAfter(ins) && pushTypeBarrier(ins, types, barrier);
}
return jsop_call(argc, /* constructing = */ false);

View File

@ -0,0 +1,19 @@
var gTestcases = new Array();
var gTc = gTestcases.length;
function TestCase( a) {
this.actual = a;
gTestcases[gTc++] = this;
}
function test() {
for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
gTestcases[gTc].actual.toString()
}
}
function testOverwritingSparseHole() {
for (var i = 0; i < 50; i++)
new TestCase(eval("VAR1 = 0; VAR2 = -1; VAR1 %= VAR2; VAR1"));
}
testOverwritingSparseHole();
test();
this.toSource();