@@ -119,8 +119,9 @@ void process_ROM_operations(Builder& builder,
119
119
// The rom_table won't work with a constant read because the table may not be initialized
120
120
ASSERT (op.index .q_l != 0 );
121
121
122
+ // In case of invalid witness assignment, we set the value of index value to zero to not hit out of bound in
123
+ // ROM table
122
124
if (!has_valid_witness_assignments) {
123
- // If witness are not assigned, we set the index value to 0
124
125
builder.set_variable (index.witness_index , 0 );
125
126
}
126
127
value.assert_equal (table[index]);
@@ -140,9 +141,9 @@ void process_RAM_operations(Builder& builder,
140
141
for (auto & op : constraint.trace ) {
141
142
field_ct value = poly_to_field_ct (op.value , builder);
142
143
field_ct index = poly_to_field_ct (op.index , builder);
143
-
144
+ // In case of invalid witness assignment, we set the value of index value to zero to not hit out of bound in
145
+ // RAM table
144
146
if (!has_valid_witness_assignments) {
145
- // If witness are not assigned, we set the index value to 0
146
147
builder.set_variable (index.witness_index , 0 );
147
148
}
148
149
@@ -174,8 +175,9 @@ void process_call_data_operations(Builder& builder,
174
175
BB_ASSERT_EQ (op.access_type , 0 );
175
176
field_ct value = poly_to_field_ct (op.value , builder);
176
177
field_ct index = poly_to_field_ct (op.index , builder);
178
+ // In case of invalid witness assignment, we set the value of index value to zero to not hit out of bound in
179
+ // calldata-array
177
180
if (!has_valid_witness_assignments) {
178
- // If witness are not assigned, we set the index value to 0
179
181
builder.set_variable (index.witness_index , 0 );
180
182
}
181
183
value.assert_equal (calldata_array[index]);
0 commit comments