feat: Safeguard lookup use

Detect invalid indexes and raise internal errors.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2025-12-19 07:53:02 -06:00
parent 5d0cf95332
commit 6bc1249dc8
9 changed files with 319 additions and 119 deletions

View File

@@ -871,6 +871,8 @@ impl Engine {
debug_assert!(
query_lookup
.get_statement_loops(module_idx, stmt.sidx)
.ok()
.and_then(|entry| entry)
.is_some(),
"missing hoisted loop entry for query statement index {}",
stmt.sidx
@@ -895,6 +897,8 @@ impl Engine {
debug_assert!(
existing_table
.get_statement_loops(module_idx, stmt.sidx)
.ok()
.and_then(|entry| entry)
.is_some(),
"missing hoisted loop entry after merge for module {} stmt {}",
module_idx,