1
Fork 0

Allow arithmetic and certain bitwise ops on AtomicPtr

This is mainly to support migrating from AtomicUsize, for the strict
provenance experiment.

Fixes #95492
This commit is contained in:
Thom Chiovoloni 2022-05-10 17:04:26 -07:00 committed by Thom Chiovoloni
parent 7425fb293f
commit 2f872afdb5
No known key found for this signature in database
GPG key ID: D7733D1D7A775F0A
4 changed files with 428 additions and 3 deletions

View file

@ -513,9 +513,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
};
let ty = substs.type_at(0);
if int_type_width_signed(ty, bx.tcx()).is_some()
|| (ty.is_unsafe_ptr() && op == "xchg")
{
if int_type_width_signed(ty, bx.tcx()).is_some() || ty.is_unsafe_ptr() {
let mut ptr = args[0].immediate();
let mut val = args[1].immediate();
if ty.is_unsafe_ptr() {