From: Mark Thom Date: Sun, 13 Mar 2022 03:12:28 +0000 (-0700) Subject: point code index to switch_on_term after appending indexed clause to single-clause... X-Git-Tag: v0.9.1~112 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=5463c1d47fb93797f4105b0c91e699c25df8b10f;p=scryer-prolog.git point code index to switch_on_term after appending indexed clause to single-clause predicate (#1346) --- diff --git a/src/machine/compile.rs b/src/machine/compile.rs index 157f16ae..adef5759 100644 --- a/src/machine/compile.rs +++ b/src/machine/compile.rs @@ -1212,7 +1212,11 @@ fn append_compiled_clause( ); if lower_bound == 0 && !skeleton.core.is_dynamic { - code_ptr_opt = Some(target_pos_clause_start); + code_ptr_opt = Some(if index_loc < target_pos_clause_start { + index_loc + } else { + target_pos_clause_start + }); } }