Fix execute after free issue with llvm (and presumably cranelift?)

This commit is contained in:
Lachlan Sneff
2019-03-04 14:41:56 -08:00
parent 039ebdcf75
commit 7ef2c0dece
6 changed files with 88 additions and 48 deletions

View File

@ -278,7 +278,7 @@ impl LLVMBackend {
info: &ModuleInfo,
local_func_index: LocalFuncIndex,
) -> Option<NonNull<vm::Func>> {
let index = local_func_index.index();
let index = info.imported_functions.len() + local_func_index.index();
let name = if cfg!(target_os = "macos") {
format!("_fn{}", index)
} else {