diff --git a/halo2-base/src/lib.rs b/halo2-base/src/lib.rs index 3ff4bc90..82c28e2a 100644 --- a/halo2-base/src/lib.rs +++ b/halo2-base/src/lib.rs @@ -346,10 +346,14 @@ impl<'a, F: ScalarField> Context<'a, F> { { self.total_fixed += 1; } - self.fixed_col += 1; - if self.fixed_col == self.fixed_columns.len() { - self.fixed_col = 0; - self.fixed_offset += 1; + self.fixed_offset += 1; + if self.fixed_offset == self.max_rows { + self.fixed_col += 1; + self.fixed_offset = 0; + + if self.fixed_col >= self.fixed_columns.len() { + panic!("NOT ENOUGH FIXED COLUMNS"); + } } cell }