Bug 184 - Function calls in declarations cause crash
Summary: Function calls in declarations cause crash
Status: RESOLVED FIXED
Alias: None
Product: UPPAAL
Classification: Unclassified
Component: Engine (show other bugs)
Version: 3.5.9
Hardware: All All
: P2 normal
Assignee: Gerd Behrmann
URL:
Depends on:
Blocks:
 
Reported: 2005-08-19 22:06 CEST by Gerd Behrmann
Modified: 2005-08-21 15:52 CEST (History)
0 users

See Also:
Architecture:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerd Behrmann 2005-08-19 22:06:20 CEST
Calling functions in any of the following places causes a crash:

- Template instantiation (as part of the argument())
- Range specification (of integers)
- Array declaration (when used in dimension)

Calling a function in any of these places is valid as long as the function is side effect free and does not 
depend on any state variables.
Comment 1 Gerd Behrmann 2005-08-21 15:52:30 CEST
A fixed has been checked into CVS.

One problem remains:

int f() { return 2; }
int a[f()] = { 1, 2 };

is not allowed by the parser. This is a different problem, though: The parser is unable to evaluate f(), thus 
it cannot check that the initialiser has the correct length. Without the initialiser everything is fine.