clamp lower_bound_of_target_clause index (#840)

This commit is contained in:
Mark
2023-12-18 15:21:30 -07:00
parent 335330690f
commit 299df50066
2 changed files with 7 additions and 9 deletions

View File

@@ -49,7 +49,7 @@ fn lower_bound_of_target_clause(skeleton: &mut PredicateSkeleton, target_pos: us
let index = target_pos - 1;
if let Some(index_loc) = skeleton.clauses[index]
let index = if let Some(index_loc) = skeleton.clauses[index]
.opt_arg_index_key
.switch_on_term_loc()
{
@@ -66,7 +66,9 @@ fn lower_bound_of_target_clause(skeleton: &mut PredicateSkeleton, target_pos: us
}
} else {
index
}
};
index.clamp(0, skeleton.clauses.len() - 1)
}
fn derelictize_try_me_else(