Opened 11 years ago

Closed 11 years ago

#2724 closed defect (fixed)

Return error for non-constructor functions returning external objects

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone: 1.9.1
Component: Frontend Version: trunk
Keywords: Cc:

Description

Code like the following is dangerous, because the Id destructor will be called on function exit (since it is a local variable...). Make the front-end return an error here instead.

import Id = ModelicaServices.modcount.HeapString;

function shapeDescrTo3D
  input State state;
  input String descr;
  input Real length, width, height;
  input Real[3] at;
  input Real extra;
  output Id id;

Change History (2)

comment:1 by Martin Sjölund, 11 years ago

Owner: changed from somebody to Martin Sjölund
Status: newaccepted

comment:2 by Martin Sjölund, 11 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.