Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#3188 closed defect (fixed)

Array indexing generates bad code

Reported by: Adrian Pop Owned by: Mahder Alemseged Gebremedhin
Priority: high Milestone: 1.9.4
Component: Code Generation Version: trunk
Keywords: Cc: Mahder Alemseged Gebremedhin

Description

We generate bad code for this model:

function f
  input Real t;
  output Boolean arr[4];
algorithm
  arr[{1, 2}] := {true, false};
  arr[{3, 4}] := {false, true};
end f;

model ArrayIndexing
  Boolean gates[4](each start = false);
equation
  gates = f(time);
end ArrayIndexing;

Change History (4)

comment:1 by Mahder Alemseged Gebremedhin, 10 years ago

Owner: changed from Lennart Ochel to Mahder Alemseged Gebremedhin
Status: newaccepted

comment:2 by Mahder Alemseged Gebremedhin, 10 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in r24930. Test cases added in r24947.

comment:3 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:4 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.