Bug 1240521 - IonBuilder processSwitchEnd returns ControlStatus_Error on allocation errors. r=h4writer

This commit is contained in:
Nicolas B. Pierron 2016-03-08 13:19:34 +00:00
parent 1996b83ba5
commit a7ff33a68b
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,13 @@
// |jit-test| allow-oom
var egc = 138;
function SwitchTest(value) {
switch (value) {
case 0:
break
case new Number:
result = 8
case oomAfterAllocations(egc):
}
}
!(SwitchTest(4) === 4);
!(SwitchTest(true) === 2);

View File

@ -3054,7 +3054,7 @@ IonBuilder::processSwitchEnd(DeferredEdge* breaks, jsbytecode* exitpc)
successor = newBlock(current, exitpc);
if (!successor)
return ControlStatus_Ended;
return ControlStatus_Error;
// If there is current, the current block flows into this one.
// So current is also a predecessor to this block