]> Repositorios git - scryer-prolog.git/commitdiff
FIXED: arg/3 for partial strings
authorMarkus Triska <[email protected]>
Tue, 29 Apr 2025 20:48:13 +0000 (22:48 +0200)
committerMark Thom <[email protected]>
Tue, 8 Jul 2025 05:38:12 +0000 (22:38 -0700)
This address #2924, reported by @haijinSk. Thank you a lot!

Example:

    ?- arg(2, "a", A).
       A = [].

The fact that such a mistake in macro usage is even possible could be
a sign that the macro definition should be stricter.

src/machine/machine_state_impl.rs

index ede17fa69d1792e948932feb33a1e703d8a1b7a9..baa2539413a6fd7c3fe83ffa10124ff26f3bb3d3 100644 (file)
@@ -934,7 +934,7 @@ impl MachineState {
                                         unify_fn!(*self, pstr_loc_as_cell!(pstr_loc + c.len_utf8()), a3);
                                     } else {
                                         let tail_idx = Heap::pstr_tail_idx(pstr_loc);
-                                        unify_fn!(*self, self.heap[tail_idx]);
+                                        unify_fn!(*self, self.heap[tail_idx], a3);
                                     }
 
                                     /*