Bug 1428453 - Baldr: use new traps for the already-reported trap (r=bbouvier)

This commit is contained in:
Luke Wagner 2018-02-15 20:41:50 -06:00
parent 004a93c6fa
commit 3f567b26ea
2 changed files with 12 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;