Bug 16309 – DMD segfault with __traits(getProtection)
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2016-07-22T00:13:00Z
Last change time
2017-01-17T18:41:39Z
Keywords
ice, ice-on-valid-code
Assigned to
nobody
Creator
cauterite
Comments
Comment #0 by cauterite — 2016-07-22T00:13:13Z
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: https://github.com/dlang/dmd/blob/05e9e840e1be228ce0b7db8618d881894977d43e/src/traits.d#L590
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 StringExp()'.
Next step is find out why 'crcHexString' has 'PROTundefined'.