Enable clif verifier in debug mode, fix issue with verifier

This commit is contained in:
Mark McCaskey
2020-02-14 11:32:49 -08:00
parent 8faac62bc0
commit 5e3147db08
2 changed files with 7 additions and 4 deletions

View File

@ -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,
});
@ -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,
});
@ -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,

View File

@ -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();
}