]> Repositorios git - scryer-prolog.git/commitdiff
point code index to switch_on_term after appending indexed clause to single-clause...
authorMark Thom <[email protected]>
Sun, 13 Mar 2022 03:12:28 +0000 (20:12 -0700)
committerMark Thom <[email protected]>
Sun, 13 Mar 2022 03:44:09 +0000 (20:44 -0700)
src/machine/compile.rs

index 157f16aeda4f7701529ab41033793022455c4d8a..adef57592df308179a4c80302fe2d41115737188 100644 (file)
@@ -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
+                    });
                 }
             }