]> Repositorios git - scryer-prolog.git/commitdiff
use heap_loc to refer to 0-arity atom instead of str_loc
authorMark Thom <[email protected]>
Wed, 8 Dec 2021 05:26:46 +0000 (22:26 -0700)
committerMark Thom <[email protected]>
Fri, 7 Jan 2022 04:44:41 +0000 (21:44 -0700)
src/lib/builtins.pl
src/machine/machine_state_impl.rs

index e27a1f43e3bf9710f2392dfbac1afbb4a4df2663..79b94a51bc8221fc984a7fcae83e8e4fe2273e66 100644 (file)
@@ -590,7 +590,7 @@ throw(Ball) :-
 :- non_counted_backtracking '$iterate_find_all'/4.
 
 '$iterate_find_all'(Template, Goal, _, LhOffset) :-
-    call(Goal),
+    '$call'(Goal),
     '$copy_to_lh'(LhOffset, Template),
     '$fail'.
 '$iterate_find_all'(_, _, Solutions, LhOffset) :-
index dfaa502eb70b3aaefd2e3872a215b5fb161b4a68..e408a6e9fed7f81a44b60743fc16a3370944b629 100644 (file)
@@ -1,7 +1,6 @@
 use crate::arena::*;
 use crate::atom_table::*;
 use crate::types::*;
-
 use crate::clause_types::*;
 use crate::forms::*;
 use crate::heap_iter::*;
@@ -3377,11 +3376,15 @@ impl MachineState {
             self.heap.push(atom_as_cell!(name, arity));
 
             for i in 0..arity {
-        self.heap.push(heap_loc_as_cell!(h + i + 1));
-        }
+                self.heap.push(heap_loc_as_cell!(h + i + 1));
+            }
 
-            str_loc_as_cell!(h)
-    };
+            if arity == 0 {
+                heap_loc_as_cell!(h)
+            } else {
+                str_loc_as_cell!(h)
+            }
+        };
 
         (self.bind_fn)(self, r, f_a);
     }