Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable cranelift's verifier by default #882

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/api/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ impl Config {
.enable("avoid_div_traps")
.expect("should be valid flag");

// Invert cranelift's default-on verification to instead default off.
flags
.set("enable_verifier", "false")
.expect("should be valid flag");

Config {
debug_info: false,
features: Default::default(),
Expand Down
10 changes: 8 additions & 2 deletions crates/fuzzing/src/oracles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use wasmtime::*;
pub fn instantiate(wasm: &[u8], strategy: Strategy) {
let mut config = Config::new();
config
.cranelift_debug_verifier(true)
.strategy(strategy)
.expect("failed to enable lightbeam");
let engine = Engine::new(&config);
Expand Down Expand Up @@ -60,7 +61,10 @@ pub fn instantiate(wasm: &[u8], strategy: Strategy) {
/// You can control which compiler is used via passing a `Strategy`.
pub fn compile(wasm: &[u8], strategy: Strategy) {
let mut config = Config::new();
config.strategy(strategy).unwrap();
config
.cranelift_debug_verifier(true)
.strategy(strategy)
.unwrap();
let engine = Engine::new(&config);
let store = Store::new(&engine);
let _ = Module::new(&store, wasm);
Expand Down Expand Up @@ -254,7 +258,9 @@ pub fn make_api_calls(api: crate::generators::api::ApiCalls) {
match call {
ApiCall::ConfigNew => {
assert!(config.is_none());
config = Some(Config::new());
let mut cfg = Config::new();
cfg.cranelift_debug_verifier(true);
config = Some(cfg);
}

ApiCall::ConfigDebugInfo(b) => {
Expand Down