]> Repositorios git - scryer-prolog.git/commitdiff
don't add default index for dynamic predicates unless defined at toplevel
authorMark Thom <[email protected]>
Thu, 3 Oct 2019 04:30:00 +0000 (22:30 -0600)
committerMark Thom <[email protected]>
Thu, 3 Oct 2019 04:30:00 +0000 (22:30 -0600)
src/prolog/machine/compile.rs

index 58cbcfc593f1030adc2c9071069b1666338ac5af..2554e256ab49c80798820a5997ee599abdf7550f 100644 (file)
@@ -407,8 +407,11 @@ impl ClauseCodeGenerator {
         for ((name, arity), _) in dynamic_code_dir {
             wam.indices.dynamic_code_dir.insert((name.owning_module(), name.clone(), arity),
                                                 DynamicPredicateInfo::default());
-            wam.indices.code_dir.entry((name, arity))
-               .or_insert(CodeIndex::dynamic_undefined(self.module_name.clone()));
+
+            if self.module_name.as_str() == "user" {
+                wam.indices.code_dir.entry((name, arity))
+                   .or_insert(CodeIndex::dynamic_undefined(self.module_name.clone()));
+            }
         }
 
         for ((name, arity), p) in self.pi_to_loc {