diff --git a/air-script/tests/list_comprehension/list_comprehension.rs b/air-script/tests/list_comprehension/list_comprehension.rs index 7032f485..a64ba5ba 100644 --- a/air-script/tests/list_comprehension/list_comprehension.rs +++ b/air-script/tests/list_comprehension/list_comprehension.rs @@ -88,7 +88,7 @@ impl Air for ListComprehensionAir { let aux_next = aux_frame.next(); result[0] = aux_current[0] - E::from(main_current[0]) * E::from(8_u64) * aux_current[7]; result[1] = aux_current[0] - E::from(main_current[0]) * (aux_next[4] - aux_next[8]); - result[2] = aux_current[2] - E::from(main_current[0]) * (aux_current[5] - aux_current[9]); + result[2] = aux_current[2] - E::from(main_current[0]) * (aux_current[5] - aux_current[10]); result[3] = aux_current[0] - (E::ZERO + aux_current[1] - aux_current[4] - aux_current[8] + E::ONE + aux_current[2] - aux_current[5] - aux_current[9] + E::from(2_u64) + aux_current[3] - aux_current[6] - aux_current[10]); } } \ No newline at end of file diff --git a/parser/src/ast/expression.rs b/parser/src/ast/expression.rs index 262d701f..e115d7f0 100644 --- a/parser/src/ast/expression.rs +++ b/parser/src/ast/expression.rs @@ -767,13 +767,13 @@ impl SymbolAccess { Type::Felt => unreachable!(), Type::Vector(len) if idx >= len => Err(InvalidAccessError::IndexOutOfBounds), Type::Vector(_) => Ok(Self { - access_type: AccessType::Index(idx), + access_type: AccessType::Index(base_range.start + idx), ty: Some(Type::Felt), ..self.clone() }), Type::Matrix(rows, _) if idx >= rows => Err(InvalidAccessError::IndexOutOfBounds), Type::Matrix(_, cols) => Ok(Self { - access_type: AccessType::Index(idx), + access_type: AccessType::Index(base_range.start + idx), ty: Some(Type::Vector(cols)), ..self.clone() }),