diff --git a/js/src/wasm/WasmBaselineCompile.cpp b/js/src/wasm/WasmBaselineCompile.cpp index 5cd8cc832ab8..07ee05fb5610 100644 --- a/js/src/wasm/WasmBaselineCompile.cpp +++ b/js/src/wasm/WasmBaselineCompile.cpp @@ -8357,7 +8357,11 @@ BaseCompiler::emitWait(ValType type, uint32_t byteSize) default: MOZ_CRASH(); } - masm.branchTest32(Assembler::Signed, ReturnReg, ReturnReg, oldTrap(Trap::ThrowReported)); + + Label ok; + masm.branchTest32(Assembler::NotSigned, ReturnReg, ReturnReg, &ok); + trap(Trap::ThrowReported); + masm.bind(&ok); return true; } @@ -8376,7 +8380,11 @@ BaseCompiler::emitWake() return true; emitInstanceCall(lineOrBytecode, SigPII_, ExprType::I32, SymbolicAddress::Wake); - masm.branchTest32(Assembler::Signed, ReturnReg, ReturnReg, oldTrap(Trap::ThrowReported)); + + Label ok; + masm.branchTest32(Assembler::NotSigned, ReturnReg, ReturnReg, &ok); + trap(Trap::ThrowReported); + masm.bind(&ok); return true; } diff --git a/js/src/wasm/WasmStubs.cpp b/js/src/wasm/WasmStubs.cpp index bb4bad611adf..5cd13199cd19 100644 --- a/js/src/wasm/WasmStubs.cpp +++ b/js/src/wasm/WasmStubs.cpp @@ -1731,13 +1731,13 @@ wasm::GenerateStubs(const ModuleEnvironment& env, const FuncImportVector& import case Trap::IntegerDivideByZero: case Trap::ImpreciseSimdConversion: case Trap::StackOverflow: + case Trap::ThrowReported: break; // The TODO list of "old" traps to convert to new traps: case Trap::OutOfBounds: case Trap::UnalignedAccess: case Trap::IndirectCallToNull: - case Trap::IndirectCallBadSig: - case Trap::ThrowReported: { + case Trap::IndirectCallBadSig: { CallableOffsets offsets; if (!GenerateOldTrapExit(masm, trap, &throwLabel, &offsets)) return false;