Bug ID 115
Summary Union literals as rvalues yields different values every run
Classification Unclassified
Product GDC
Version 4.8.x
Hardware x86_64
OS Linux
Status NEW
Severity normal
Priority Normal
Component gdc
Assignee ibuclaw@gdcproject.org
Reporter klas.bjorkqvist@gmail.com

When running the following program:

a.d
------
import std.stdio;

union _f {
  float f;
  uint i;
}

void func(const uint x) {
  writeln(x);
}

void main() {
  float a = 123.0;
  const l = _f(a);
  func(l.i);
  func(_f(a).i);
}
----

multiple times, the value printed for "_f(a).i" is different each time, and
appears mostly random when compared to the value of "l.i". 

> gdc a.d && ./a.out
1123418112
430703264
> ./a.out           
1123418112
3680514720
> ./a.out
1123418112
2543067808


You are receiving this mail because: