Commit 9026b6e
authored
Concurrency: fix UB in DefaultActor initialization (#40263)
This fixes a latent UB instance in the `DefaultActor` implementation
that has haunted the Windows target. The shared constructor for the
type caused an errant typo that happened to compile which introduced
UB but happened to work for the non-Windows cases. This happened to
work for the other targets as `swift::atomic` had a `std::atomic` at
on most configurations, and the C delegate for the Actor initializer
happened to overlap and initialize the memory properly. The Windows
case used an inline pointer width value but would be attempted to be
initialized as a `std::atomic`. Relying on the overlap is unsafe to
assume, and we should use the type's own constructor which delegates
appropriately.1 parent 424bc40 commit 9026b6e
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
688 | | - | |
| 688 | + | |
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| |||
0 commit comments