Skip to content

Commit

Permalink
Generalize these strings, stop chasing changing error messages.
Browse files Browse the repository at this point in the history
A runtime error encountered during instantiation has to be one of the kinds of errors that can occur during instantiation, out of bounds covers the cases like initializing memory or table entries that don't exist.
  • Loading branch information
nlewycky committed May 6, 2021
1 parent 77fa434 commit f29d3ef
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 40 deletions.
9 changes: 1 addition & 8 deletions fuzz/fuzz_targets/jit_cranelift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,7 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message
.contains("RuntimeError: memory out of bounds: data segment does not fit")
|| error_message
.contains("RuntimeError: table out of bounds: elements segment does not fit")
|| error_message.contains(
"RuntimeError: out of bounds table access: elements segment does not fit",
)
{
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
return;
}
panic!("{}", e);
Expand Down
9 changes: 1 addition & 8 deletions fuzz/fuzz_targets/jit_llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,7 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message
.contains("RuntimeError: memory out of bounds: data segment does not fit")
|| error_message
.contains("RuntimeError: table out of bounds: elements segment does not fit")
|| error_message.contains(
"RuntimeError: out of bounds table access: elements segment does not fit",
)
{
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
return;
}
panic!("{}", e);
Expand Down
9 changes: 1 addition & 8 deletions fuzz/fuzz_targets/jit_singlepass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,7 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message
.contains("RuntimeError: memory out of bounds: data segment does not fit")
|| error_message
.contains("RuntimeError: table out of bounds: elements segment does not fit")
|| error_message.contains(
"RuntimeError: out of bounds table access: elements segment does not fit",
)
{
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
return;
}
panic!("{}", e);
Expand Down
9 changes: 1 addition & 8 deletions fuzz/fuzz_targets/metering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,7 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message
.contains("RuntimeError: memory out of bounds: data segment does not fit")
|| error_message
.contains("RuntimeError: table out of bounds: elements segment does not fit")
|| error_message.contains(
"RuntimeError: out of bounds table access: elements segment does not fit",
)
{
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
return;
}
panic!("{}", e);
Expand Down
9 changes: 1 addition & 8 deletions fuzz/fuzz_targets/native_cranelift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,7 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message
.contains("RuntimeError: memory out of bounds: data segment does not fit")
|| error_message
.contains("RuntimeError: table out of bounds: elements segment does not fit")
|| error_message.contains(
"RuntimeError: out of bounds table access: elements segment does not fit",
)
{
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
return;
}
panic!("{}", e);
Expand Down

0 comments on commit f29d3ef

Please sign in to comment.