Add illegal arithmetic runtime error

This commit is contained in:
Lachlan Sneff
2019-03-04 19:56:02 -08:00
parent 3be7144892
commit fe8f8a0132
5 changed files with 35 additions and 77 deletions

View File

@ -70,6 +70,7 @@ public:
IncorrectCallIndirectSignature = 1,
MemoryOutOfBounds = 2,
CallIndirectOOB = 3,
IllegalArithmetic = 4,
Unknown,
};
@ -98,6 +99,12 @@ private:
case Type::MemoryOutOfBounds:
out << "memory access out-of-bounds";
break;
case Type::CallIndirectOOB:
out << "call_indirect out-of-bounds";
break;
case Type::IllegalArithmetic:
out << "illegal arithmetic operation";
break;
case Type::Unknown:
default:
out << "unknown";
@ -142,7 +149,6 @@ extern "C" {
}
[[noreturn]] void throw_trap(WasmTrap::Type ty) {
std::cout << "throwing trap: " << ty << std::endl;
throw WasmTrap(ty);
}