D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6678 - optlink crash with large array of structs
Summary: optlink crash with large array of structs
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: diagnostic, Optlink
: 8536 (view as issue list)
Depends on:
Blocks:
 
Reported: 2011-09-15 12:59 UTC by bearophile_hugs
Modified: 2017-10-25 03:17 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2011-09-15 12:59:56 UTC
This D2 program:


double[7_000_000] array = void;
void main() {}


DMD 2.055 gives an expected error message:
test.d(1): Error: index 7000000 overflow for static array



But this similar program:


struct Foo {
    double x /*= 0*/;
}
Foo[7_000_000] array = void;
void main() {}


Causes a crash of optlink at EIP=004114FC.
Comment 1 bearophile_hugs 2012-08-11 05:47:53 UTC
*** Issue 8536 has been marked as a duplicate of this issue. ***
Comment 2 Andrej Mitrovic 2013-02-16 12:06:53 UTC
Apart from the linker crash this could also be a DMD accepts-invalid bug.
Comment 3 Walter Bright 2017-10-25 03:17:43 UTC
(In reply to bearophile_hugs from comment #0)
> But this similar program:
> [...]
> Causes a crash of optlink at EIP=004114FC.

Now causes:

test.d(4): Error: variable test.array size of 0x3567e00 exceeds max allowed size 0x1000000