wip - fix #636, check memory before calculating offset
This commit is contained in:
@@ -163,8 +163,9 @@ impl Compiler {
|
|||||||
let body_len = compilation.get(i).body.len();
|
let body_len = compilation.get(i).body.len();
|
||||||
funcs.push((ptr, body_len));
|
funcs.push((ptr, body_len));
|
||||||
}
|
}
|
||||||
let module_vmctx_info = {
|
|
||||||
let ofs = VMOffsets::new(target_config.pointer_bytes(), &module);
|
let ofs = VMOffsets::new(target_config.pointer_bytes(), &module);
|
||||||
|
if ofs.num_defined_memories > 0 {
|
||||||
|
let module_vmctx_info = {
|
||||||
let memory_offset =
|
let memory_offset =
|
||||||
ofs.vmctx_vmmemory_definition_base(DefinedMemoryIndex::new(0)) as i64;
|
ofs.vmctx_vmmemory_definition_base(DefinedMemoryIndex::new(0)) as i64;
|
||||||
ModuleVmctxInfo {
|
ModuleVmctxInfo {
|
||||||
@@ -185,6 +186,9 @@ impl Compiler {
|
|||||||
Some(bytes)
|
Some(bytes)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
let jt_offsets = compilation.get_jt_offsets();
|
let jt_offsets = compilation.get_jt_offsets();
|
||||||
|
|||||||
Reference in New Issue
Block a user