Bug 1139368 - Set FilterTypeSet dependency in improveThisTypesForCall. r=h4writer

This commit is contained in:
Jan de Mooij 2015-03-10 13:14:38 +01:00
parent 6c9f728df0
commit 382bb03e1d
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,10 @@
// |jit-test| error: TypeError
function f() {
for (var i=2; i<2; i++) {
var a = /a/;
}
for (var i=0; i<2; i++) {
a.exec("aaa");
}
}
f();

View File

@ -10019,6 +10019,11 @@ IonBuilder::improveThisTypesForCall()
MFilterTypeSet *filter = MFilterTypeSet::New(alloc(), thisDef, types);
current->add(filter);
current->rewriteAtDepth(-2, filter);
// FilterTypeSetPolicy::adjustInputs will insert an infallible Unbox(Object)
// for the input. Don't hoist this unbox above the getprop or getelem
// operation.
filter->setDependency(current->peek(-1)->toInstruction());
return true;
}