mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1280921 - select must handle AnyType. r=bbouvier
--HG-- extra : rebase_source : 71d62d13c1b22c00483d9615cd5385c4d2a9674c extra : histedit_source : 5c813dc05bda607267a19868edeed84b31803490
This commit is contained in:
parent
381bbf5b50
commit
13dab670e2
@ -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();
|
||||
|
32
js/src/jit-test/tests/wasm/regress/select-any.js
Normal file
32
js/src/jit-test/tests/wasm/regress/select-any.js
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user