Bug 1280921 - select must handle AnyType. r=bbouvier

--HG--
extra : rebase_source : 71d62d13c1b22c00483d9615cd5385c4d2a9674c
extra : histedit_source : 5c813dc05bda607267a19868edeed84b31803490
This commit is contained in:
Lars T Hansen 2016-06-24 13:52:03 +02:00
parent 381bbf5b50
commit 13dab670e2
2 changed files with 35 additions and 1 deletions

View File

@ -4819,9 +4819,10 @@ void
BaseCompiler::pushReturned(ExprType type)
{
switch (type) {
case ExprType::Void:
case ExprType::Void: {
pushVoid();
break;
}
case ExprType::I32: {
RegI32 rv = needI32();
captureReturnedI32(rv);
@ -5380,6 +5381,7 @@ BaseCompiler::emitSelect()
RegI32 rc = popI32();
switch (type) {
case AnyType:
case ExprType::Void: {
popValueStackBy(2);
pushVoid();

View File

@ -0,0 +1,32 @@
// |jit-test| test-also-wasm-baseline
load(libdir + "wasm.js");
// Bug 1280921
var m1 = wasmEvalText(
`(module
(type $type0 (func))
(func $func0
(select (unreachable) (return (nop)) (loop (i32.const 1))))
(export "" 0))`);
try {
m1();
} catch (e) {
if (!(e instanceof Error && e.message.match(/unreachable executed/)))
throw e;
}
var m2 = wasmEvalText(
`(module
(type $type0 (func))
(func $func0
(select (i32.const 26) (unreachable) (i32.const 3)))
(export "" 0))`);
try {
m2();
} catch (e) {
if (!(e instanceof Error && e.message.match(/unreachable executed/)))
throw e;
}