www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7380] New: Crash trying to use address of variable in struct constructor at module level

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

           Summary: Crash trying to use address of variable in struct
                    constructor at module level
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: smjg iname.com



DMD 2.057, Windows Vista 32-bit
----------
struct TestStruct {
    this(int* d) {}
}

int xm;
auto tsm = TestStruct(&xm);
----------
C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd inout_ctor_bug.d
inout_ctor_bug.d(6): Error: static variable xm cannot be read at compile time
----------
Problem signature:
  Problem Event Name:    APPCRASH
  Application Name:    dmd.exe
  Application Version:    0.0.0.0
  Application Timestamp:    00000000
  Fault Module Name:    dmd.exe
  Fault Module Version:    0.0.0.0
  Fault Module Timestamp:    00000000
  Exception Code:    c0000005
  Exception Offset:    0007e672
  OS Version:    6.0.6002.2.2.0.768.3
  Locale ID:    2057
  Additional Information 1:    482b
  Additional Information 2:    fe3cbbb77b564d5f0cb2cc6fc75b3c2f
  Additional Information 3:    73f1
  Additional Information 4:    1e2657c1444006182528bd2953dbb394
----------

The error message the compiler actually emits seems correct, but the crash
certainly isn't.

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




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/648777b74259462eaa402b657411f2bd5950c9b0
Fix issue 7380 Crash trying to use address of variable in struct constructor
at module level

https://github.com/D-Programming-Language/dmd/commit/7536fd03d1326cbf5c327cce87f398dfbd46368d


Fix issue 7380 segfault trying to use address of global variable in CTFE

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |FIXED



D1 merge
https://github.com/D-Programming-Language/dmd/commit/11d3b001ee0db391710e4bedcfd98b354f82862e

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