[Issue 3815] New: Array sum to a constant and assign to not initialized dynamic array
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Feb 18 09:55:06 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3815
Summary: Array sum to a constant and assign to not initialized
dynamic array
Product: D
Version: 2.040
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: druntime
AssignedTo: sean at invisibleduck.org
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-02-18 09:55:05 PST ---
import std.stdio: writeln;
void main() {
int[] a1 = [1, 2, 3];
auto a3 = a1[] + 4;
writeln(a3); // 1 2 3 0 1935766371 1768515939 1764585331
}
At the end a3 contains garbage, and there's no compile-time error.
--
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