Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2704 closed defect (fixed)

impure functions are not constant

Reported by: Lennart Ochel Owned by: Lennart Ochel
Priority: high Milestone: 1.9.1
Component: Backend Version: trunk
Keywords: Cc:

Description

Remove simple equations does not handle impure functions correctly:

Example 1:

model test
  Boolean a = initial();
end test;

Example 2:

model test2
  impure function impureTest
    output Integer x;

    external "C" x = _impureTest() annotation(Include = "#include <stdlib.h>
                                                         int _impureTest()
                                                         {
                                                           static int d=0;
                                                           return (double)++d;
                                                         }");
  end impureTest;

  Real r = impureTest();
end test2;

Change History (3)

comment:1 by Lennart Ochel, 11 years ago

Status: newaccepted

comment:2 by Lennart Ochel, 11 years ago

Resolution: fixed
Status: acceptedclosed

This is fixed in r20907.

comment:3 by Lennart Ochel, 11 years ago

See also r20789 and r20848.

Note: See TracTickets for help on using tickets.