1011 – illegal import declaration causes compile time segfault

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1011 - illegal import declaration causes compile time segfault
Summary: illegal import declaration causes compile time segfault
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 All
: P3 normal
Assignee: Walter Bright
URL:
Keywords: ice-on-invalid-code, patch
Depends on:
Blocks:
Reported: 2007年02月28日 08:10 UTC by Thomas Kühne
Modified: 2014年02月16日 15:25 UTC (History)
1 user (show)

See Also:


Attachments
Patch against DMD 2.028 (367 bytes, patch)
2009年04月19日 03:19 UTC, Don
Details | Diff
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Thomas Kühne 2007年02月28日 08:10:14 UTC
-- 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 2 Don 2009年04月19日 03:19:14 UTC
Created attachment 326 [details] 
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 Don 2009年05月14日 05:22:01 UTC
Fixed DMD2.030 and DMD1.045.


AltStyle によって変換されたページ (->オリジナル) /