Opened 10 years ago

Closed 10 years ago

#2724 closed defect (fixed)

Return error for non-constructor functions returning external objects

Reported by: sjoelund.se Owned by: sjoelund.se
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 Changed 10 years ago by sjoelund.se

  • Owner changed from somebody to sjoelund.se
  • Status changed from new to accepted

comment:2 Changed 10 years ago by sjoelund.se

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.