Skip to content

Commit 8dc1b45

Browse files
committed
expand on the AtomicCall fast path issue
1 parent 0ad234b commit 8dc1b45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resources/deliberate-ub.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ We should evaluate whether there truly is some use-case here that is not current
1616
The LLVM IR we generate here contains `noundef` so this UB is not just a specification artifact.<br>
1717
Furthermore, `compare_exchange` will compare padding bytes, which leads to UB.
1818
It is not clear how to best specify a useful `compare_exchange` that can work on padding bytes,
19-
see the [discussion here](https://github.com/rust-lang/unsafe-code-guidelines/issues/449).
19+
see the [discussion here](https://github.com/rust-lang/unsafe-code-guidelines/issues/449).<br>
20+
The alternative is to not use the "fast path" for problematic types (and fall back to the SeqLock), but that requires some way to query at `const`-time whether the type contains padding (or provenance).
21+
(Or of course one can use inline assembly, but it would be better if that was not required.)
2022

2123
### Cases related to aliasing
2224

0 commit comments

Comments
 (0)