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

Bug 593

Summary: faulty initialization of array of doubles
Product: UPPAAL Reporter: Marius Mikučionis <marius>
Component: EngineAssignee: Marius Mikučionis <marius>
Status: ASSIGNED ---    
Severity: major CC: adavid
Priority: P5    
Version: 4.1.19   
Hardware: All   
OS: Linux   
Architecture:

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