synchronize offset table growth with the borrowing of offset pointers

This commit is contained in:
Mark Thom
2025-06-20 23:19:32 -07:00
committed by Mark Thom
parent 1332611f83
commit 2844b5a958
8 changed files with 141 additions and 50 deletions

View File

@@ -48,6 +48,7 @@ pub(super) fn set_code_index<'a, LS: LoadState<'a>>(
}
};
drop(code_idx_ptr);
payload.retraction_info.push_record(record);
}
@@ -507,6 +508,7 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
let code_ptr = code_index_tbl.lookup((*code_index).into());
if !code_ptr.is_undefined() && !code_ptr.is_dynamic_undefined() {
drop(code_ptr);
let old_index_ptr = code_index.replace(code_index_tbl, IndexPtr::undefined());
self.payload.retraction_info.push_record(
@@ -559,6 +561,9 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
let target_code_ptr = code_index_tbl.lookup(target_code_idx.into());
if module_code_ptr == target_code_ptr {
drop(module_code_ptr);
drop(target_code_ptr);
let old_index_ptr = target_code_idx
.replace(code_index_tbl, IndexPtr::undefined());
payload