Bug 7439 – Compound assignment causes segmentation fault

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-02-04T14:47:00Z
Last change time
2015-06-09T05:11:55Z
Keywords
ice, pull
Assigned to
yebblies
Creator
iteronvexor

Comments

Comment #0 by iteronvexor — 2012-02-04T14:47:00Z
Tested on Gnu/Linux, 64-bit, DMD-2.057 --------------------------8<----------------------------8<-------------------------------------- struct A(int r, int c){ public: alias r R; alias c C; alias float[R * C] Data; Data _data; alias _data this; this(Data ar){ _data = ar; } pure ref float opIndex(size_t rr, size_t cc){ return _data[cc + rr * C]; } } void main(){ A!(2, 2) a = A!(2, 2)([8, 3, 2, 9]); a[0,0] -= a[0,0] * 2.0; } -------------------------->8---------------------------->8-------------------------------------- workaround: avoid compound assignment operators.
Comment #1 by yebblies — 2012-02-04T19:31:09Z
Comment #2 by yebblies — 2012-02-19T23:57:26Z