Bug 13874 – Invalid FunctionTypeOf segfault the compiler
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-17T17:39:00Z
Last change time
2015-01-19T16:22:01Z
Keywords
ice, pull
Assigned to
nobody
Creator
pro.mathias.lang
Comments
Comment #0 by pro.mathias.lang — 2014-12-17T17:39:47Z
The following code crashes the compiler:
````
import std.traits : FunctionTypeOf;
enum DummyEnum;
static assert(!is(FunctionTypeOf!DummyEnum));
````
% ./projects/dlang/dmd/src/dmd segv.d
[3] 8952 segmentation fault (core dumped)
Valgrind believes it's a stack overflow:
==8964== Stack overflow in thread 1: can't grow stack to 0xffe801f1c
==8964==
==8964== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==8964== Access not within mapped region at address 0xFFE801F1C
==8964== at 0x411591: TypeEnum::getProperty(Loc, Identifier*, int) (in /mnt/shared/projects/dlang/dmd/src/dmd)
Tested with dmd 2.066.1 & master (v2.067-devel-1b8db26).