Bug 7379 – DMD segfaults on semantic3 phase when alias enum this;

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-01-27T11:05:00Z
Last change time
2012-01-29T00:22:27Z
Assigned to
nobody
Creator
nazriel6969

Comments

Comment #0 by nazriel6969 — 2012-01-27T11:05:07Z
// ----- struct Test { enum ENUM { M1, M2, M3 } alias ENUM this; } class Test2 { this(Test test) { } this(string test) { this(Test()); } } void main() {} // --- This code snippet cause DMD to segfault on semantic3 phase. Backtracing showes that problem occurs in mtype.c: 7804 gdb dmd ./run -c ./test.d Full backtrace: // --- #0 0x00000000004c6450 in TypeStruct::wildConvTo(Type*) () No symbol table info available. #1 0x00000000004ca02b in TypeFunction::callMatch(Expression*, ArrayBase<Expression>*, int) () No symbol table info available. #2 0x000000000048e745 in fp2(void*, FuncDeclaration*) () No symbol table info available. #3 0x000000000048e164 in overloadApply(FuncDeclaration*, int (*)(void*, FuncDeclaration*), void*) () No symbol table info available. #4 0x000000000048e22d in overloadResolveX(Match*, FuncDeclaration*, Expression*, ArrayBase<Expression>*) () No symbol table info available. #5 0x000000000048e2b2 in FuncDeclaration::overloadResolve(Loc, Expression*, ArrayBase<Expression>*, int) () No symbol table info available. #6 0x0000000000488534 in CallExp::semantic(Scope*) () No symbol table info available. #7 0x00000000004ebe7b in ExpStatement::semantic(Scope*) () No symbol table info available. #8 0x00000000004f4254 in CompoundStatement::semantic(Scope*) () No symbol table info available. #9 0x0000000000491ea2 in FuncDeclaration::semantic3(Scope*) () No symbol table info available. #10 0x00000000004f5bd8 in AggregateDeclaration::semantic3(Scope*) () No symbol table info available. #11 0x00000000004b7a00 in Module::semantic3() () No symbol table info available. #12 0x0000000000403aec in main () // --- I've noticed this problem since 2.056. At the moment using DMD from Git 2.058. Operating system: //--- Linux d3 3.0.6-gentoo #1 SMP Sun Oct 9 12:00:00 CEST 2011 x86_64 Intel(R) Core(TM) i5 CPU M 450 @ 2.40GHz GenuineIntel GNU/Linux //--- Occurs also on FreeBSD and MacOSX. With both -m32 and -m64. Not tested on Windows tho. Removing //--- alias ENUM this; //--- From test case solves problem. Best Regards, Damian Ziemba
Comment #1 by github-bugzilla — 2012-01-29T00:22:01Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5adc29b322bbeaa162e2d731edf014c989fdfe60 fix Issue 7379 - DMD segfaults on semantic3 phase when alias enum this