Skip to content

Commit

Permalink
aot: Ensure that all direct calls have compiled functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dinfuehr committed Jan 3, 2025
1 parent 9589e90 commit 441fc27
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions dora-runtime/src/compiler/aot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,16 @@ fn prepare_lazy_call_sites(_vm: &VM, ctc: &CompiledTransitiveClosure) {
type_params,
const_pool_offset_from_ra,
} => {
let address = ctc.function_addresses.get(&(*fct_id, type_params.clone()));
if let Some(address) = address {
let ra = code.instruction_start().offset(*offset as usize);
let const_pool_address = ra.ioffset(*const_pool_offset_from_ra as isize);
let address = ctc
.function_addresses
.get(&(*fct_id, type_params.clone()))
.cloned()
.expect("missing function");
let ra = code.instruction_start().offset(*offset as usize);
let const_pool_address = ra.ioffset(*const_pool_offset_from_ra as isize);

unsafe {
*const_pool_address.to_mut_ptr::<Address>() = *address;
}
unsafe {
*const_pool_address.to_mut_ptr::<Address>() = address;
}
}

Expand Down

0 comments on commit 441fc27

Please sign in to comment.