Skip to content

Commit 3353306

Browse files
committed
don't replace undefined module predicates (#2232)
1 parent f30cee7 commit 3353306

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/machine/load_state.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -497,19 +497,21 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
497497
}
498498

499499
for (key, code_index) in removed_module.code_dir.iter_mut() {
500-
if skipped_local_predicates.contains(&key) {
500+
if skipped_local_predicates.contains(key) {
501501
continue;
502502
}
503503

504-
let old_index_ptr = code_index.replace(IndexPtr::undefined());
504+
if !code_index.is_undefined() && !code_index.is_dynamic_undefined() {
505+
let old_index_ptr = code_index.replace(IndexPtr::undefined());
505506

506-
self.payload
507-
.retraction_info
508-
.push_record(RetractionRecord::ReplacedModulePredicate(
509-
module_name,
510-
*key,
511-
old_index_ptr,
512-
));
507+
self.payload
508+
.retraction_info
509+
.push_record(RetractionRecord::ReplacedModulePredicate(
510+
module_name,
511+
*key,
512+
old_index_ptr,
513+
));
514+
}
513515
}
514516

515517
for (key, skeleton) in removed_module.extensible_predicates.drain(..) {

0 commit comments

Comments
 (0)