www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7439] New: Compound assignment causes segmentation fault

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7439

           Summary: Compound assignment causes segmentation fault
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: iteronvexor gmail.com



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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 04 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7439


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Severity|critical                    |major



https://github.com/D-Programming-Language/dmd/pull/695

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 04 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7439


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



Fixed D2:
https://github.com/D-Programming-Language/dmd/commit/34cb3dec9de6c1c01850447c29fc2bc81d386382

Can't reproduce with D1.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 19 2012