Issue 22076 - hashOf(S) can segfault if S.toHash is forwarded via 'alias this' to a receiver which may be null
Summary: hashOf(S) can segfault if S.toHash is forwarded via 'alias this' to a receive...
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-06-23 02:28 UTC by Nathan S.
Modified: 2021-07-24 17:57 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-06-23 02:28:58 UTC
Demonstration:

---
void main()
{
    struct S
    {
        Object a;
        alias a this;
    }

    cast(void) .object.hashOf(S.init); // Segfaults.
}
---
Comment 1 Dlang Bot 2021-06-23 02:32:45 UTC
@n8sh created dlang/druntime pull request #3501 "[stable] hashOf(S) can segfault if S.toHash is forwarded via 'alias this' to a receiver which may be null" fixing this issue:

- Fix 22076 - hashOf(S) can segfault if S.toHash is forwarded via 'alias this' to a receiver which may be null

https://github.com/dlang/druntime/pull/3501
Comment 2 Dlang Bot 2021-06-23 03:05:54 UTC
dlang/druntime pull request #3501 "[stable] hashOf(S) can segfault if S.toHash is forwarded via 'alias this' to a receiver which may be null" was merged into stable:

- 3b861301cfe1dbe3e4a02093312e6f2c68454daa by Nathan Sashihara:
  Fix 22076 - hashOf(S) can segfault if S.toHash is forwarded via 'alias this' to a receiver which may be null

https://github.com/dlang/druntime/pull/3501
Comment 3 Dlang Bot 2021-07-24 17:57:10 UTC
dlang/druntime pull request #3515 "merge stable" was merged into master:

- ed76256b7dd63748ba135467e9d8be5722b579cc by Nathan Sashihara:
  Fix 22076 - hashOf(S) can segfault if S.toHash is forwarded via 'alias this' to a receiver which may be null

- 186e58071e35ac1866f371b44b50cf560ef06f9b by Nathan Sashihara:
  Fix 22076 - hashOf(S) can segfault if S.toHash is forwarded via 'alias this' to a receiver which may be null

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