FIXED: arg/3 for partial strings

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.
This commit is contained in:
Markus Triska
2025-04-29 22:48:13 +02:00
committed by Mark Thom
parent d6b6eda77d
commit 8763a42c98

View 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);
}
/*