@@ -1316,7 +1316,8 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
|||||||
.clause_clause_locs
|
.clause_clause_locs
|
||||||
.extend(&clause_clause_locs.make_contiguous()[0..]);
|
.extend(&clause_clause_locs.make_contiguous()[0..]);
|
||||||
|
|
||||||
let skeleton = cg.skeleton;
|
let mut skeleton = cg.skeleton;
|
||||||
|
skeleton.core.is_dynamic = settings.is_dynamic();
|
||||||
|
|
||||||
self.add_extensible_predicate(key, skeleton, predicates.compilation_target);
|
self.add_extensible_predicate(key, skeleton, predicates.compilation_target);
|
||||||
}
|
}
|
||||||
@@ -2138,7 +2139,7 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
|||||||
.map(|skeleton| skeleton.predicate_info())
|
.map(|skeleton| skeleton.predicate_info())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
let mut predicate_info = self
|
let predicate_info = self
|
||||||
.wam_prelude
|
.wam_prelude
|
||||||
.indices
|
.indices
|
||||||
.get_predicate_skeleton(&self.payload.predicates.compilation_target, &key)
|
.get_predicate_skeleton(&self.payload.predicates.compilation_target, &key)
|
||||||
@@ -2200,8 +2201,6 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
|||||||
(0..skeleton.clauses.len()).map(Some).collect(),
|
(0..skeleton.clauses.len()).map(Some).collect(),
|
||||||
false, // the builtin M:'$clause'/2 is never dynamic.
|
false, // the builtin M:'$clause'/2 is never dynamic.
|
||||||
);
|
);
|
||||||
|
|
||||||
predicate_info.is_dynamic = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.payload
|
self.payload
|
||||||
|
|||||||
@@ -466,13 +466,39 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
|||||||
None => return,
|
None => return,
|
||||||
};
|
};
|
||||||
|
|
||||||
for (key, code_index) in removed_module.code_dir.iter_mut() {
|
let mut skipped_local_predicates = IndexSet::with_hasher(FxBuildHasher::default());
|
||||||
match removed_module
|
|
||||||
.local_extensible_predicates
|
for ((local_compilation_target, key), skeleton) in
|
||||||
.get(&(CompilationTarget::User, *key))
|
removed_module.local_extensible_predicates.iter()
|
||||||
{
|
{
|
||||||
Some(skeleton) if skeleton.is_multifile => continue,
|
skipped_local_predicates.insert(key);
|
||||||
_ => {}
|
|
||||||
|
if skeleton.is_multifile {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(code_index) = removed_module.code_dir.get_mut(key) {
|
||||||
|
if let Some(global_skeleton) = self
|
||||||
|
.wam_prelude
|
||||||
|
.indices
|
||||||
|
.get_predicate_skeleton(local_compilation_target, key)
|
||||||
|
{
|
||||||
|
let old_index_ptr = code_index.replace(if global_skeleton.core.is_dynamic {
|
||||||
|
IndexPtr::dynamic_undefined()
|
||||||
|
} else {
|
||||||
|
IndexPtr::undefined()
|
||||||
|
});
|
||||||
|
|
||||||
|
self.payload.retraction_info.push_record(
|
||||||
|
RetractionRecord::ReplacedModulePredicate(module_name, *key, old_index_ptr),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (key, code_index) in removed_module.code_dir.iter_mut() {
|
||||||
|
if skipped_local_predicates.contains(&key) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let old_index_ptr = code_index.replace(IndexPtr::undefined());
|
let old_index_ptr = code_index.replace(IndexPtr::undefined());
|
||||||
|
|||||||
Reference in New Issue
Block a user