[Issue 3978] New: Compiler crash on improper struct initialization
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Mar 16 17:18:16 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3978
Summary: Compiler crash on improper struct initialization
Product: D
Version: 2.030
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: paul.d.anderson at comcast.net
--- Comment #0 from Paul D. Anderson <paul.d.anderson at comcast.net> 2010-03-16 17:18:14 PDT ---
The following code fragment causes the compiler to crash with the following
useful information:
"dmd.exe has encountered a problem and needs to close. We are sorry for the
inconvenience."
//--------------------
public S s = S();
public struct S {
private int[] a = [ 0 ];
}
//--------------------
I realize the code is incorrect, but I expected an error message, not a
trainwreck.
Adding initializer information solves the problem:
//--------------------
public S s = S([0]); // compiles correctly
public struct S {
private int[] a = [ 0 ];
}
//--------------------
Eliminating the forward reference solves the problem:
//--------------------
public struct S {
private int[] a = [ 0 ];
}
public S s = S(); // compiles correctly
//--------------------
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list