File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,11 @@ func _stdlib_atomicCompareExchangeStrongPtrImpl(
28
28
expected: UnsafeMutablePointer < OpaquePointer ? > ,
29
29
desired: OpaquePointer ? ) -> Bool {
30
30
31
- // Bit-cast directly from 'OpaquePointer?' to 'Builtin.Word' because
32
- // Builtin.RawPointer can't be nil.
31
+ // We use Builtin.Word here because Builtin.RawPointer can't be nil.
33
32
let ( oldValue, won) = Builtin . cmpxchg_seqcst_seqcst_Word (
34
33
target. _rawValue,
35
- unsafeBitCast ( expected . pointee , to : Builtin . Word . self ) ,
36
- unsafeBitCast ( desired , to : Builtin . Word . self ) )
34
+ UInt ( bitPattern : expected . pointee ) . _builtinWordValue ,
35
+ UInt ( bitPattern : desired ) . _builtinWordValue )
37
36
expected. pointee = OpaquePointer ( bitPattern: Int ( oldValue) )
38
37
return Bool ( won)
39
38
}
You can’t perform that action at this time.
0 commit comments