Fix failures on test compilation.

This commit is contained in:
losfair
2020-02-11 03:03:05 +08:00
parent e17d8f20b8
commit b40edd4512
3 changed files with 10 additions and 9 deletions

View File

@ -71,13 +71,17 @@ pub fn call_protected(
TrapCode::HeapOutOfBounds => ExceptionCode::MemoryOutOfBounds,
TrapCode::TableOutOfBounds => ExceptionCode::CallIndirectOOB,
TrapCode::UnreachableCodeReached => ExceptionCode::Unreachable,
_ => ExceptionCode::Unknown,
_ => return Err(CallProtError(Box::new("unknown trap code".to_string()))),
},
EXCEPTION_STACK_OVERFLOW => ExceptionCode::Unknown,
EXCEPTION_STACK_OVERFLOW => ExceptionCode::MemoryOutOfBounds,
EXCEPTION_INT_DIVIDE_BY_ZERO | EXCEPTION_INT_OVERFLOW => {
ExceptionCode::IllegalArithmetic
}
_ => ExceptionCode::Unknown,
_ => {
return Err(CallProtError(Box::new(
"unknown exception code".to_string(),
)))
}
})))
} else {
let signal = match code as DWORD {