Skip to content

Commit d2a6582

Browse files
committed
WIP
1 parent f87f6e0 commit d2a6582

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/query.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -665,17 +665,17 @@ static void reuse_frame(query *q, unsigned num_vars)
665665
drop_choice(q);
666666

667667
frame *fold = GET_CURR_FRAME();
668+
fold->initial_slots = fold->actual_slots = num_vars;
669+
fold->no_recov = false;
668670
const frame *fnew = GET_NEW_FRAME();
669-
const slot *from = get_slot(q, fnew, 0);
670-
slot *to = get_slot(q, fold, 0);
671671

672672
for (pl_idx i = 0; i < num_vars; i++) {
673+
const slot *from = get_slot(q, fnew, i);
674+
slot *to = get_slot(q, fold, i);
673675
unshare_cell(&to->c);
674-
*to++ = *from++; // Slots are contiguous
676+
*to = *from;
675677
}
676678

677-
fold->initial_slots = fold->actual_slots = num_vars;
678-
fold->no_recov = false;
679679
q->st.sp = fold->base + fold->actual_slots;
680680
q->st.dbe->tcos++;
681681
q->total_tcos++;

tests/tests/test101.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
test1: [f,5,c,5,t,5,s,10]
2-
test2: [f,5,c,5,t,5,s,10]
3-
test3: [f,5,c,5,t,5,s,11]
1+
test1: [f,4,c,5,t,4,s,8]
2+
test2: [f,4,c,5,t,4,s,8]
3+
test3: [f,4,c,5,t,4,s,8]
44
test4: [f,4,c,5,t,4,s,8]
55
test5: [f,4,c,5,t,4,s,8]
66
test6: [f,200004,c,5,t,200004,s,500008]

0 commit comments

Comments
 (0)