Skip to content

Commit 66138dd

Browse files
committed
ScalarInt: size mismatches are a bug, do not delay the panic
1 parent 4e410a9 commit 66138dd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/intrinsics/simd.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
600600
for i in 0..dest_len {
601601
let src_index: u64 = index[usize::try_from(i).unwrap()]
602602
.unwrap_leaf()
603-
.try_to_u32()
604-
.unwrap()
603+
.to_u32()
605604
.into();
606605
let dest = this.project_index(&dest, i)?;
607606

src/shims/unix/socket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
5151

5252
let fds = &mut this.machine.fds;
5353
let sv0 = fds.insert_fd(FileDescriptor::new(SocketPair));
54-
let sv0 = Scalar::try_from_int(sv0, sv.layout.size).unwrap();
54+
let sv0 = Scalar::from_int(sv0, sv.layout.size);
5555
let sv1 = fds.insert_fd(FileDescriptor::new(SocketPair));
56-
let sv1 = Scalar::try_from_int(sv1, sv.layout.size).unwrap();
56+
let sv1 = Scalar::from_int(sv1, sv.layout.size);
5757

5858
this.write_scalar(sv0, &sv)?;
5959
this.write_scalar(sv1, &sv.offset(sv.layout.size, sv.layout, this)?)?;

0 commit comments

Comments
 (0)