[Issue 5258] New: [CTFE] Stack overflow with struct by ref
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Nov 22 17:10:33 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5258
Summary: [CTFE] Stack overflow with struct by ref
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-11-22 17:09:12 PST ---
This D2 program generates a Stack Overflow with DMD 2.050 despite the stack
dept is very small:
struct Foo { int x; }
void bar(int n, ref Foo f) {
if (n)
bar(n - 1, f);
else
f.x++;
}
int spam() {
bar(1, Foo());
return 0;
}
enum _ = spam();
void main() {}
--
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