From 5463c1d47fb93797f4105b0c91e699c25df8b10f Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Sat, 12 Mar 2022 20:12:28 -0700 Subject: [PATCH] point code index to switch_on_term after appending indexed clause to single-clause predicate (#1346) --- src/machine/compile.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 + }); } } -- 2.54.0