Bug 489

Summary: Function Calls as parameter of another function call not working properly
Product: UPPAAL Reporter: Erik Slomp <g.h.slomp>
Component: EngineAssignee: Alexandre David <adavid>
Status: RESOLVED FIXED    
Severity: normal CC: marius
Priority: P2    
Version: 4.0.8   
Hardware: PC   
OS: Windows XP   
Architecture:

Description Erik Slomp 2010-05-04 14:05:39 CEST
The usage of a function call as a parameter for another function call does not work properly.

Consider the following function:

int increase(int x){
   return ++x;
}

A simple function calls works as expected:
b = increase(1) (--> 'b' is assigned the value 2)

However the following assignment does not work as expected as it hould assign b the value 3 but it is assigned the value 0.

b = increase(increase(1))

This seems to be a known bug but not reported yet.
Comment 1 Marius Mikuńćionis 2010-05-07 10:20:52 CEST
on trunk I get b==-32767 after "b=increase(increase(1))".
it seems that the stack is messed up in a virtual machine.
Comment 2 Alexandre David 2010-05-25 15:09:54 CEST
This bug occurs whenever a function is called twice in the same expression.
This affects assignments a = foo(foo(something)) but also return statements
in other functions. This also occurs when there are several arguments.
Comment 3 Alexandre David 2010-05-25 15:24:28 CEST
Fixed in rev. 4534 for 4.0 and 4535 in the trunk.