Skip to content

Commit 6ab5a5d

Browse files
authored
Merge pull request #4570 from RalfJung/atomic-rmw-int
atomic rmw intrinsics: RHS must be an integer
2 parents 421cf19 + bc98dba commit 6ab5a5d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/intrinsics/atomic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,9 @@ trait EvalContextPrivExt<'tcx>: MiriInterpCxExt<'tcx> {
264264
let place = this.deref_pointer(place)?;
265265
let rhs = this.read_immediate(rhs)?;
266266

267+
// The LHS can be a pointer, the RHS must be an integer.
267268
if !(place.layout.ty.is_integral() || place.layout.ty.is_raw_ptr())
268-
|| !(rhs.layout.ty.is_integral() || rhs.layout.ty.is_raw_ptr())
269+
|| !rhs.layout.ty.is_integral()
269270
{
270271
span_bug!(
271272
this.cur_span(),

0 commit comments

Comments
 (0)