Bug 1011 – illegal import declaration causes compile time segfault

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-02-28T08:10:00Z
Last change time
2014-02-16T15:25:27Z
Keywords
ice-on-invalid-code, patch
Assigned to
bugzilla
Creator
thomas-dloop

Attachments

IDFilenameSummaryContent-TypeSize
3261011patch.patchPatch against DMD 2.028text/plain367

Comments

Comment #0 by thomas-dloop — 2007-02-28T08:10:14Z
-- a.d -- import b; -- b.d -- import foo 0 dmd a.d > b.d(1): ';' expected > Segmentation fault dmd b.d > b.d(1): ';' expected Program received signal SIGSEGV, Segmentation fault. 0x0000000000423610 in DsymbolTable::lookup (this=0x6118b0, ident=0x0) at dmd/dsymbol.c:858 858 sv = tab->lookup((char*)ident->string, ident->len); Current language: auto; currently c++ (gdb) bt #0 0x0000000000423610 in DsymbolTable::lookup (this=0x6118b0, ident=0x0) at dmd/dsymbol.c:858 #1 0x00000000004540d2 in Import::load (this=0x630360, sc=0x62fb10) at dmd/import.c:90 #2 0x00000000004542d1 in Import::semantic (this=0x630360, sc=0x62fb10) at dmd/import.c:120 #3 0x0000000000465aa9 in Module::semantic (this=0x62fea0) at dmd/module.c:652 #4 0x0000000000454229 in Import::load (this=0x61a1d0, sc=0x61a600) at dmd/import.c:110 #5 0x00000000004542d1 in Import::semantic (this=0x61a1d0, sc=0x61a600) at dmd/import.c:120 #6 0x0000000000465aa9 in Module::semantic (this=0x619cc0) at dmd/module.c:652 #7 0x00000000004640dc in main (argc=8, argv=0x619750) at dmd/mars.c:782
Comment #1 by thomas-dloop — 2007-03-08T10:29:24Z
Comment #2 by clugdbug — 2009-04-19T03:19:14Z
Created attachment 326 Patch against DMD 2.028 Import shouldn't do any semantic action if it doesn't know which module it's supposed to be importing. The error message I've added may be unnecessary; just returning would probably be OK.
Comment #3 by clugdbug — 2009-05-14T05:22:01Z
Fixed DMD2.030 and DMD1.045.