This commit is contained in:
Nilton Constantino
2026-02-02 19:31:23 +00:00
parent f5dafc403f
commit b6912c4369
4 changed files with 7 additions and 3 deletions
@@ -160,6 +160,8 @@ impl VirtualMachine {
// Try to resolve symbol name via ProgramImage exports
if let Some(&func_idx) = program.exports.get(entrypoint) {
program.functions[func_idx as usize].code_offset as usize
} else if let Some(&func_idx) = program.exports.get(&format!("src/main/modules:{}", entrypoint)) {
program.functions[func_idx as usize].code_offset as usize
} else {
return Err(VmInitError::EntrypointNotFound);
}
@@ -183,6 +185,8 @@ impl VirtualMachine {
(addr, idx)
} else if let Some(&func_idx) = self.program.exports.get(entrypoint) {
(self.program.functions[func_idx as usize].code_offset as usize, func_idx as usize)
} else if let Some(&func_idx) = self.program.exports.get(&format!("src/main/modules:{}", entrypoint)) {
(self.program.functions[func_idx as usize].code_offset as usize, func_idx as usize)
} else {
(0, 0)
};