D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21857 - TypeInfo_Array.compare can give wrong result when either array exceeds 2GB
Summary: TypeInfo_Array.compare can give wrong result when either array exceeds 2GB
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-04-24 02:02 UTC by Nathan S.
Modified: 2021-05-12 16:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nathan S. 2021-04-24 02:02:45 UTC
Current code:

https://github.com/dlang/druntime/blob/b4209f33e7705a58d101e5ba906bfa5d10799faa/src/object.d#L918-L934

---
    override int compare(in void* p1, in void* p2) const
    {
        void[] a1 = *cast(void[]*)p1;
        void[] a2 = *cast(void[]*)p2;

        // ... 

        return cast(int)a1.length - cast(int)a2.length;
    }
--
Comment 1 Dlang Bot 2021-04-24 02:06:07 UTC
@n8sh created dlang/druntime pull request #3450 "TypeInfo_Array.compare can give wrong result when either array exceeds 2GB" fixing this issue:

- Fix 21857: TypeInfo_Array.compare can give wrong result when either array exceeds 2GB

https://github.com/dlang/druntime/pull/3450
Comment 2 Dlang Bot 2021-04-26 23:10:11 UTC
dlang/druntime pull request #3450 "TypeInfo_Array.compare can give wrong result when either array exceeds 2GB" was merged into stable:

- 93741516a95e8d1a76290c94a7dd9d608d2660b0 by Nathan Sashihara:
  Fix 21857: TypeInfo_Array.compare can give wrong result when either array exceeds 2GB

https://github.com/dlang/druntime/pull/3450
Comment 3 Dlang Bot 2021-05-12 16:37:34 UTC
dlang/druntime pull request #3468 "merge stable" was merged into master:

- e70d111cda2c8009028a985c9ef383b8f759af32 by Nathan Sashihara:
  Fix 21857: TypeInfo_Array.compare can give wrong result when either array exceeds 2GB

https://github.com/dlang/druntime/pull/3468