Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #257 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

StructLiteralExp::toElem emits wrong value when initializing static array from element

Reported by: ChristianK Assigned to: lindquist
Priority: major Milestone:
Component: backend Version: hg tip
Keywords: Cc:

Description

struct S { int[3] i; }
extern(C) int printf(char*, ...);

const S cs = S(42);

void main() {
  S ds = S(42);
  printf("%d %d\n", cs.i[2]); // == 42, ok
  printf("%d %d\n", ds.i[2]); // random, not ok
}

Change History

04/21/09 12:28:15 changed by lindquist

We should generalize the approach we're taking for !ExpInitializerS to handle both constants and runtime values.

04/21/09 21:09:12 changed by lindquist

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in rev [1255]

Copyright © 2008, LDC Development Team.