This issue tracker is closed. Please visit UPPAAL issue tracker at Github instead.

Bug 593 - faulty initialization of array of doubles
Summary: faulty initialization of array of doubles
Status: ASSIGNED
Alias: None
Product: UPPAAL
Classification: Unclassified
Component: Engine (show other bugs)
Version: 4.1.19
Hardware: All Linux
: P5 major
Assignee: Marius Mikučionis
URL:
Depends on:
Blocks:
 
Reported: 2015-04-27 09:05 CEST by Marius Mikučionis
Modified: 2015-10-01 13:55 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 Marius Mikučionis 2015-04-27 09:05:32 CEST
Consider the following declarations:

const int N = 2;

typedef int[0, N-1] zero_t;
typedef int[1, N] one_t;

const double v1 = 1.0;
const double v2 = 2.0;
const double v3 = 3.0;
const double v4 = 4.0;
const double v5 = 5.0;

double A[2] = { v1, v2 };
double B[zero_t] = { v1, v2 };
double C[one_t] = { v1, v2 };

Queries:
simulate 1 [<=1] { A[0] } // expect 1, but gives 5
simulate 1 [<=1] { B[0] } // expect 1, but gives 5
simulate 1 [<=1] { C[1] } // expect 1, but gives 5

In this particular setting it seems that the first member gets the value of the last double constant. In slightly different settings it gives empty plot (4.1.19) or zero (4.1.20, beta7 and Stratego)
Comment 1 Marius Mikučionis 2015-10-01 13:55:33 CEST
fixed on stratego branch