digitalmars.D.bugs - [Issue 4515] New: Compiler crashes when accessing a static array returned by a function
- d-bugmail puremagic.com (38/38) Jul 26 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4515
- d-bugmail puremagic.com (12/12) Jul 27 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4515
http://d.puremagic.com/issues/show_bug.cgi?id=4515
Summary: Compiler crashes when accessing a static array
returned by a function
Product: D
Version: D2
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody puremagic.com
ReportedBy: asitdepends gmail.com
---
import std.stdio;
struct S {
int[1] get() {
return x;
}
private int[1] x;
}
void main() {
S s;
writeln(s.get()[0]);//This line crashes dmd2
}
Dmd 2.047 produces the following message:
Internal error: ../ztc/cod2.c 4333
It seems that the compiler works properly when the array size is larger than 2.
Dynamic arrays also work well.
I tried a workaround like this.
auto x = s.get()[0];
writeln(x);//This line crashes the compiler
However, this cannot fix the problem.
The last line crashes the compiler.
Same message is produced by the code.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 26 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4515
Don <clugdbug yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |clugdbug yahoo.com.au
Resolution| |DUPLICATE
*** This issue has been marked as a duplicate of issue 4414 ***
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 27 2010








d-bugmail puremagic.com