www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16309] New: DMD segfault with __traits(getProtection)


          Issue ID: 16309
           Summary: DMD segfault with __traits(getProtection)
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: cauterite gmail.com

With DMD 2.071.1, the following code segfaults the compiler:

( https://dpaste.dzfl.pl/f46383c7f31b )

    import std.digest.crc;
    pragma(msg, __traits(getProtection, crcHexString));

The problem seems to revolve around this line:
This 'crcHexString' symbol has a protection of 'PROTundefined' which causes
'protectionToChars()' to return null. In debug builds, the null triggers the
assertion on the next line; in release builds, it triggers a segfault in 'new

Next step is find out why 'crcHexString' has 'PROTundefined'.

Jul 21 2016