diff --git a/CHANGELOG.md b/CHANGELOG.md index fb7cce41a9c..7ef0dd4d811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/lib/clif-backend/src/resolver.rs b/lib/clif-backend/src/resolver.rs index efc038d5843..6c5ad2eec4e 100644 --- a/lib/clif-backend/src/resolver.rs +++ b/lib/clif-backend/src/resolver.rs @@ -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::{ @@ -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))) },