index: guard the $in cartesian cap against u64 overflow; drop debug print

This commit is contained in:
2026-08-02 12:41:28 +03:00
parent adcf0014a9
commit 0d264c6c57
2 changed files with 3 additions and 1 deletions

View File

@@ -706,6 +706,9 @@ fn evaluate_index(gpa: std.mem.Allocator, ix: *const Index, clauses: []const Cla
}
var combos: u64 = 1;
for (0..run) |i| {
// A single huge $in list (or a product over 100) falls back to a
// scan; checking the factor first keeps the product from wrapping.
if (counts[i] > max_combos) return null;
combos *= counts[i];
if (combos > max_combos) return null;
}