[Issue 12198] New: Catch some wrong overlapping array operations at compile time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 18 13:41:11 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12198
Summary: Catch some wrong overlapping array operations at
compile time
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: diagnostic
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2014-02-18 13:40:56 PST ---
void main() {
int[1] a, b;
a[] = a[];
a[] = a[] + b[];
a[] = a[] * 2;
}
With DMD 2.065rc1 that code compiles, and then it gives at run-time:
object.Error: Overlapping arrays in vector operation: 4 byte(s) overlap of 4
I suggest to catch similar basic cases at compile-time.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list