Skip to content

Commit

Permalink
Enable clif verifier in debug mode, fix issue with verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Feb 14, 2020
1 parent 8faac62 commit 5e3147d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/clif-backend/src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ impl FuncEnvironment for FunctionEnvironment {
let local_memory_bound = func.create_global_value(ir::GlobalValueData::Load {
base: local_memory_ptr,
offset: (vm::LocalMemory::offset_bound() as i32).into(),
global_type: ptr_type,
global_type: ir::types::I32,
readonly: false,
});

Expand Down Expand Up @@ -551,7 +551,7 @@ impl FuncEnvironment for FunctionEnvironment {
let table_count = func.create_global_value(ir::GlobalValueData::Load {
base: table_struct_ptr,
offset: (vm::LocalTable::offset_count() as i32).into(),
global_type: ptr_type,
global_type: ir::types::I32,
// The table length can change, so it can't be readonly.
readonly: false,
});
Expand Down Expand Up @@ -673,7 +673,8 @@ impl FuncEnvironment for FunctionEnvironment {
colocated: false,
});

pos.ins().symbol_value(ir::types::I64, sig_index_global)
let val = pos.ins().symbol_value(ir::types::I64, sig_index_global);
pos.ins().ireduce(ir::types::I32, val)

// let dynamic_sigindices_array_ptr = pos.ins().load(
// ptr_type,
Expand Down
4 changes: 3 additions & 1 deletion lib/clif-backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ fn get_isa() -> Box<dyn isa::TargetIsa> {
builder.set("opt_level", "speed_and_size").unwrap();
builder.set("jump_tables_enabled", "false").unwrap();

if cfg!(not(test)) {
if cfg!(test) || cfg!(debug_assertions) {
builder.set("enable_verifier", "true").unwrap();
} else {
builder.set("enable_verifier", "false").unwrap();
}

Expand Down

0 comments on commit 5e3147d

Please sign in to comment.