[Issue 13073] New: Wrong uint array comparison
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Jul 8 02:16:58 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13073
Issue ID: 13073
Summary: Wrong uint array comparison
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: rejects-valid
Severity: major
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
Tagged this as major, but it's borderline critical.
Found by "Archibald" and "anonymous" on NG D.learn:
http://forum.dlang.org/thread/oykqbalusjretfkquolz@forum.dlang.org
void main() {
uint x = 0x22_DF_FF_FF;
uint y = 0xA2_DF_FF_FF;
assert(!(x < y && y < x)); // OK.
uint[] a = [x];
uint[] b = [y];
assert(!(a < b && b < a)); // Fails.
uint[1] a1 = [x];
uint[1] b1 = [y];
assert(!(a1 < b1 && b1 < a1)); // Fails.
}
--
More information about the Digitalmars-d-bugs
mailing list