1
0
mirror of https://github.com/fluencelabs/wasmer synced 2025-07-24 20:02:04 +00:00

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
lib

@@ -61,6 +61,8 @@ enum WasmTrapType {
Unreachable = 0,
IncorrectCallIndirectSignature = 1,
MemoryOutOfBounds = 2,
CallIndirectOOB = 3,
IllegalArithmetic = 4,
Unknown,
}
@@ -407,6 +409,12 @@ impl ProtectedCaller for LLVMProtectedCaller {
WasmTrapType::MemoryOutOfBounds => RuntimeError::Trap {
msg: "memory out-of-bounds access".into(),
},
WasmTrapType::CallIndirectOOB => RuntimeError::Trap {
msg: "call_indirect out-of-bounds".into(),
},
WasmTrapType::IllegalArithmetic => RuntimeError::Trap {
msg: "illegal arithmetic operation".into(),
},
WasmTrapType::Unknown => RuntimeError::Trap {
msg: "unknown trap".into(),
},