Skip to content

Commit

Permalink
Improve clif verifier error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Feb 14, 2020
1 parent 5e3147d commit 23275d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## **[Unreleased]**

- [#1218](https://github.com/wasmerio/wasmer/pull/1218) Enable Cranelift verifier in debug mode. Fix bug with table indices being the wrong type.
- [#787](https://github.com/wasmerio/wasmer/pull/787) New crate `wasmer-interface-types` to implement WebAssembly Interface Types.
- [#1213](https://github.com/wasmerio/wasmer/pull/1213) Fixed WASI `fdstat` to detect `isatty` properly.
- [#1192](https://github.com/wasmerio/wasmer/pull/1192) Use `ExceptionCode` for error representation.
Expand Down
9 changes: 7 additions & 2 deletions lib/clif-backend/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
use byteorder::{ByteOrder, LittleEndian};
use cranelift_codegen::{
binemit::{Stackmap, StackmapSink},
ir, isa, Context,
ir, isa, CodegenError, Context,
};
use rayon::prelude::*;
use std::{
Expand Down Expand Up @@ -124,7 +124,12 @@ impl FuncResolverBuilder {
&mut local_trap_sink,
&mut stackmap_sink,
)
.map_err(|e| CompileError::InternalError { msg: e.to_string() })?;
.map_err(|e| match e {
CodegenError::Verifier(v) => CompileError::InternalError {
msg: format!("Verifier error: {}", v),
},
_ => CompileError::InternalError { msg: e.to_string() },
})?;
ctx.clear();
Ok((code_buf, (reloc_sink, local_trap_sink)))
},
Expand Down

0 comments on commit 23275d0

Please sign in to comment.