Skip to content

Commit

Permalink
Merge #325
Browse files Browse the repository at this point in the history
325: change func_index offset by number of imported funcs r=syrusakbary a=MarkMcCaskey

This appears to fix the issue of the debug statements reporting the wrong function index

Co-authored-by: Mark McCaskey <mark@wasmer.io>
  • Loading branch information
bors[bot] and Mark McCaskey committed Apr 4, 2019
2 parents 1ac689c + 9e601c4 commit e03a4a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/clif-backend/src/module_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,10 @@ impl<'module, 'isa, 'data> ModuleEnvironment<'data> for ModuleEnv<'module, 'isa>
.special_param(ir::ArgumentPurpose::VMContext)
.expect("missing vmctx parameter");

let func_index = pos.ins().iconst(ir::types::I32, func_index.index() as i64);
let func_index = pos.ins().iconst(
ir::types::I32,
func_index.index() as i64 + self.module.info.imported_functions.len() as i64,
);

pos.ins().call(start_debug, &[vmctx, func_index]);

Expand Down

0 comments on commit e03a4a2

Please sign in to comment.