Bug 489 - Function Calls as parameter of another function call not working properly
Summary: Function Calls as parameter of another function call not working properly
Status: RESOLVED FIXED
Alias: None
Product: UPPAAL
Classification: Unclassified
Component: Engine (show other bugs)
Version: 4.0.8
Hardware: PC Windows XP
: P2 normal
Assignee: Alexandre David
URL:
Depends on:
Blocks:
 
Reported: 2010-05-04 14:05 CEST by Erik Slomp
Modified: 2010-05-25 15:24 CEST (History)
1 user (show)

See Also:
Architecture:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.