Issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess
Summary: atomicLoad does not work for class arguments with -preview=nosharedaccess
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: 2024-11-07 10:12 UTC by Sönke Ludwig
Modified: 2024-11-16 23:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Sönke Ludwig 2024-11-07 10:12:13 UTC
---
shared Object i;
atomicLoad(i);
---

When compiled on DMD 2.109.1, with `-preview=nosharedaccess`, results in:

core/internal/atomic.d(155): Error: direct access to shared `*cast(shared(inout(Object))*)resultValuePtr` is not allowed, see `core.atomic`

Note that, although the DRuntime implementation differs, LDC produces a similar error.
Comment 1 Richard (Rikki) Andrew Cattermole 2024-11-07 10:45:54 UTC
A quick look shows that core.* has no exception for this message.

I'm going to try and add an exclusion specifically for core.internal.atomic as that is a compiler implementation detail of the platform.
Comment 2 Dlang Bot 2024-11-07 10:59:32 UTC
@rikkimax created dlang/dmd pull request #17053 "Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess" fixing this issue:

- Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess

https://github.com/dlang/dmd/pull/17053
Comment 3 Dlang Bot 2024-11-10 21:40:03 UTC
dlang/dmd pull request #17053 "Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess" was merged into stable:

- ace7cea7731f493d11f906dde1fe5a7a793523a2 by Richard (Rikki) Andrew Cattermole:
  Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess

https://github.com/dlang/dmd/pull/17053
Comment 4 Dlang Bot 2024-11-16 23:27:18 UTC
dlang/dmd pull request #17069 "Merge stable" was merged into master:

- a7c85ec3be036e87a6fd76e0d4cd0fba36dd1e07 by Richard (Rikki) Andrew Cattermole:
  Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess

https://github.com/dlang/dmd/pull/17069