digitalmars.D.bugs - [Issue 6250] New: [CTFE] Crash when swapping two pointers to arrays.
- d-bugmail puremagic.com (49/49) Jul 04 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6250
- d-bugmail puremagic.com (13/13) Jul 31 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6250
http://d.puremagic.com/issues/show_bug.cgi?id=6250 Summary: [CTFE] Crash when swapping two pointers to arrays. Product: D Version: D1 & D2 Platform: All OS/Version: All Status: NEW Keywords: ice-on-valid-code Severity: major Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: yebblies gmail.com --- Comment #0 from yebblies <yebblies gmail.com> 2011-07-05 12:36:57 EST --- void swap(int[]* lhs, int[]* rhs) { *lhs = *rhs; *rhs = *lhs; } int ctfeSort() { int[][2] x; swap(&x[0], &x[1]); return 0; } void main() { enum x = ctfeSort(); } Causes a stack overflow with dmd master (2.054) The same thing happens when using references. void swap(ref int[] lhs, ref int[] rhs) { lhs = rhs; rhs = lhs; } int ctfeSort() { int[][2] x; swap(x[0], x[1]); return 0; } void main() { enum x = ctfeSort(); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 04 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6250 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED --- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2011-07-31 12:08:39 PDT --- https://github.com/D-Programming-Language/dmd/commit/7ef3b2bb9e740df39108957ae5e3b2aa8253d351 https://github.com/D-Programming-Language/dmd/pull/284 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 31 2011