Skip to content

Commit

Permalink
Return an error, rather than using Try + unreachable!.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewycky committed Mar 18, 2021
1 parent df625e7 commit cd645ba
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fuzz/fuzz_targets/equivalence_jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ fn maybe_instantiate_singlepass(wasm_bytes: &[u8]) -> Result<Option<Instance>> {
let module = Module::new(&store, &wasm_bytes);
let module = match module {
Ok(m) => m,
Err(ref e) => {
Err(e) => {
let error_message = format!("{}", e);
if error_message.contains("Validation error: invalid result arity: func type returns multiple values") || error_message.contains("Validation error: blocks, loops, and ifs accept no parameters when multi-value is not enabled") || error_message.contains("multi-value returns not yet implemented") {
return Ok(None);
}
module?;
unreachable!("");
return Err(e.into());
}
};
let instance = Instance::new(&module, &imports! {})?;
Expand Down

0 comments on commit cd645ba

Please sign in to comment.