Skip to content

Commit

Permalink
change func_index offset by number of imported funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Apr 4, 2019
1 parent 1ac689c commit 9e601c4
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 9e601c4

Please sign in to comment.