Fixed LLVM compilation

This commit is contained in:
Syrus
2020-05-02 14:51:51 -07:00
parent b5ebd7b084
commit 14061b9171

View File

@ -337,7 +337,10 @@ impl FuncTranslator {
if let Some((index, _)) =
func_names.iter().find(|(_, name)| *name == target)
{
reloc_target = Some(RelocationTarget::LocalFunc(index));
let local_index = wasm_module
.local_func_index(index)
.expect("Only local functions should be relocated");
reloc_target = Some(RelocationTarget::LocalFunc(local_index));
} else {
if let Some(libcall) = libcalls.get(&target.to_string()) {
reloc_target = Some(RelocationTarget::LibCall(*libcall));