FIXED: correct partial string tail calculation in arg/3

This addresses another aspect of #2924, found by @haijinSk.
Thank you again!

Example:

    ?- "aaaaaaa" = [_,_,_,_,_,_|T], arg(2, T, 2).
       false.
This commit is contained in:
Markus Triska
2025-05-01 09:18:00 +02:00
committed by Mark Thom
parent 8763a42c98
commit 709dc041eb

View File

@@ -933,7 +933,7 @@ impl MachineState {
if char_iter.next().is_some() {
unify_fn!(*self, pstr_loc_as_cell!(pstr_loc + c.len_utf8()), a3);
} else {
let tail_idx = Heap::pstr_tail_idx(pstr_loc);
let tail_idx = Heap::pstr_tail_idx(pstr_loc + c.len_utf8());
unify_fn!(*self, self.heap[tail_idx], a3);
}