Skip to content

Commit

Permalink
Fix multidimensional array constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-larraz committed Aug 8, 2023
1 parent 342ce3f commit 5c27d8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lustre/lustreNodeGen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ let rec expand_tuple' pos accum bounds lhs rhs =
let over_index_types (e, i) _ =
E.mk_select_and_push e (E.mk_index_var i), succ i
in
let expr, _ = List.fold_left over_index_types (expr, 0) array_index_types in
let start = (List.length lhs_index_tl + 1) - List.length array_index_types in
let expr, _ = List.fold_left over_index_types (expr, start) array_index_types in
expand_tuple' pos accum (E.Bound b :: bounds)
((lhs_index_tl, state_var) :: lhs_tl)
((rhs_index_tl, expr) :: rhs_tl)
Expand Down
12 changes: 12 additions & 0 deletions tests/regression/success/test-issue-951.lus
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node master__Operator1 ( input1:int^3 ) returns ( output1:int^3^2 )
var
Edge_3:int^3;
Edge_4:int^3^2;

let
Edge_3 = input1;
Edge_4 = Edge_3 ^ 2;
output1 = Edge_4;
--%MAIN ;
check output1[1][0] = input1[0];
tel

0 comments on commit 5c27d8f

Please sign in to comment.