[Issue 16651] atomicOp!"-="(ulong, uint) = wrong result/codegen
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Nov 1 14:05:37 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16651
safety0ff.bugz <safety0ff.bugz at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |safety0ff.bugz at gmail.com
--- Comment #2 from safety0ff.bugz <safety0ff.bugz at gmail.com> ---
(In reply to ag0aep6g from comment #1)
>
> Looks like a bug in druntime code (core.atomic) rather than dmd.
Yup, atomicFetchSub [1] doesn't widen the modifier before negating it.
This is necessary when the modifier is unsigned and narrower than the value's
type.
[1] https://github.com/dlang/druntime/blob/master/src/core/atomic.d#L684
--
More information about the Digitalmars-d-bugs
mailing list