Skip to content

Commit

Permalink
Rollup merge of #126159 - RalfJung:scalarint-size-mismatch, r=oli-obk
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr authored Jun 10, 2024
2 parents 71a8883 + 66138dd commit 334a205
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
for i in 0..dest_len {
let src_index: u64 = index[usize::try_from(i).unwrap()]
.unwrap_leaf()
.try_to_u32()
.unwrap()
.to_u32()
.into();
let dest = this.project_index(&dest, i)?;

Expand Down
4 changes: 2 additions & 2 deletions src/shims/unix/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {

let fds = &mut this.machine.fds;
let sv0 = fds.insert_fd(FileDescriptor::new(SocketPair));
let sv0 = Scalar::try_from_int(sv0, sv.layout.size).unwrap();
let sv0 = Scalar::from_int(sv0, sv.layout.size);
let sv1 = fds.insert_fd(FileDescriptor::new(SocketPair));
let sv1 = Scalar::try_from_int(sv1, sv.layout.size).unwrap();
let sv1 = Scalar::from_int(sv1, sv.layout.size);

this.write_scalar(sv0, &sv)?;
this.write_scalar(sv1, &sv.offset(sv.layout.size, sv.layout, this)?)?;
Expand Down

0 comments on commit 334a205

Please sign in to comment.