Skip to content

Commit 2385b3f

Browse files
committed
Transform the last error place to an immediate instead
1 parent 5222c08 commit 2385b3f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/shims/foreign_items.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
418418

419419
"__errno_location" | "__error" => {
420420
let errno_place = this.machine.last_error.unwrap();
421-
let errno_scalar: Scalar<Tag> = this.check_mplace_access(errno_place.into(), Some(Size::from_bits(32)))?.unwrap().into();
422-
this.write_scalar(errno_scalar, dest)?;
421+
this.write_scalar(errno_place.to_ref().to_scalar()?, dest)?;
423422
}
424423

425424
"getenv" => {

0 commit comments

Comments
 (0)