Skip to content

Commit

Permalink
Convert more missed places
Browse files Browse the repository at this point in the history
  • Loading branch information
1c3t3a committed Jan 31, 2025
1 parent 65fb642 commit b4abf2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tools/miri/src/intrinsics/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ trait EvalContextPrivExt<'tcx>: MiriInterpCxExt<'tcx> {
let place = this.deref_pointer(place)?;
let rhs = this.read_immediate(rhs)?;

if !place.layout.ty.is_integral() && !place.layout.ty.is_unsafe_ptr() {
if !place.layout.ty.is_integral() && !place.layout.ty.is_raw_ptr() {
span_bug!(
this.cur_span(),
"atomic arithmetic operations only work on integer and raw pointer types",
Expand Down
4 changes: 2 additions & 2 deletions src/tools/miri/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
// Some more operations are possible with atomics.
// The return value always has the provenance of the *left* operand.
Add | Sub | BitOr | BitAnd | BitXor => {
assert!(left.layout.ty.is_unsafe_ptr());
assert!(right.layout.ty.is_unsafe_ptr());
assert!(left.layout.ty.is_raw_ptr());
assert!(right.layout.ty.is_raw_ptr());
let ptr = left.to_scalar().to_pointer(this)?;
// We do the actual operation with usize-typed scalars.
let left = ImmTy::from_uint(ptr.addr().bytes(), this.machine.layouts.usize);
Expand Down

0 comments on commit b4abf2f

Please sign in to comment.