From: Mark Thom Date: Wed, 3 Feb 2021 08:22:13 +0000 (-0700) Subject: use find_inner_choice_instr when appending an indexed clause to an indexed subsequence X-Git-Tag: v0.9.0~150^2~66^2~11 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=88f1160e2b6199ee613d3501a834a0fb5de54a44;p=scryer-prolog.git use find_inner_choice_instr when appending an indexed clause to an indexed subsequence --- diff --git a/src/machine/compile.rs b/src/machine/compile.rs index 13ac32c5..2d05ae34 100644 --- a/src/machine/compile.rs +++ b/src/machine/compile.rs @@ -1001,22 +1001,22 @@ fn append_compiled_clause( AppendOrPrepend::Append, ); - if lower_bound + 1 == target_pos { - let lower_bound_clause_start = find_inner_choice_instr( - code, - skeleton.clauses[lower_bound].clause_start, - index_loc, - ); + let target_pos_clause_start = find_inner_choice_instr( + code, + skeleton.clauses[target_pos - 1].clause_start, + index_loc, + ); + if lower_bound + 1 == target_pos { set_switch_var_offset( code, index_loc, - lower_bound_clause_start - index_loc, + target_pos_clause_start - index_loc, retraction_info, ); } - skeleton.clauses[target_pos - 1].clause_start + target_pos_clause_start // skeleton.clauses[target_pos - 1].clause_start } _ => { skeleton.clauses[target_pos].opt_arg_index_key += clause_loc;