www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21893] New: core.atomic calls itself recursively


          Issue ID: 21893
           Summary: core.atomic calls itself recursively
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: alphaglosined gmail.com

Windows, ldc2 1.25.1 64bit, the source matches up for this in druntime ~master.

Known to happen in atomicLoad, atomicStore during testing. But I would expect
it to also apply to atomicFetchAdd and atomicFetchSub.

Making the function calls for the same name explicit to use
core.internal.atomic fixes the issue i.e.

atomicStore!ms(*cast(T*)&val, *cast(Thunk*)&newval);


core.internal.atomic.atomicStore!ms(cast(T*)&val, *cast(Thunk*)&newval);

Without these changes, the arguments line up with itself and will end in a
stack overflow.

May 05 2021