Allow wasmtime/v8 to differ on errors slightly (#3348)

I'm not sure why when run repeatedly v8 has different limits on
call-stack-size but it's not particularly interesting to assert exact
matches here, so this should fix a fuzz-bug-failure found on oss-fuzz.
This commit is contained in:
Alex Crichton
2021-09-14 10:40:24 -05:00
committed by GitHub
parent 4d4779b563
commit b759514124

View File

@@ -267,7 +267,21 @@ fn assert_error_matches(wasmtime: &anyhow::Error, v8: &str) {
"data segment is out of bounds",
])
}
TrapCode::UnreachableCodeReached => return verify_v8(&["unreachable"]),
TrapCode::UnreachableCodeReached => {
return verify_v8(&[
"unreachable",
// All the wasms we test use wasm-smith's
// `ensure_termination` option which will `unreachable` when
// "fuel" runs out within the wasm module itself. This
// sometimes manifests as a call stack size exceeded in v8,
// however, since v8 sometimes has different limits on the
// call-stack especially when it's run multiple times. To
// get these error messages to line up allow v8 to say the
// call stack size exceeded when wasmtime says we hit
// unreachable.
"Maximum call stack size exceeded",
]);
}
TrapCode::IntegerDivisionByZero => {
return verify_v8(&["divide by zero", "remainder by zero"])
}