]> git.lizzy.rs Git - rust.git/commitdiff
Transform the last error place to an immediate instead
authorChristian Poveda <christianpoveda@protonmail.com>
Fri, 18 Oct 2019 19:44:48 +0000 (14:44 -0500)
committerChristian Poveda <christianpoveda@protonmail.com>
Sun, 20 Oct 2019 12:55:26 +0000 (07:55 -0500)
src/shims/foreign_items.rs

index 51be7ea5bcd392a0a9345b3f2e41b404a727e6e5..1933aee1151dc3b3b4cef7b8a5a610ca1ff55b90 100644 (file)
@@ -415,8 +415,7 @@ fn emulate_foreign_item(
 
             "__errno_location" | "__error" => {
                 let errno_place = this.machine.last_error.unwrap();
-                let errno_scalar: Scalar<Tag> = this.check_mplace_access(errno_place.into(), Some(Size::from_bits(32)))?.unwrap().into();
-                this.write_scalar(errno_scalar, dest)?;
+                this.write_scalar(errno_place.to_ref().to_scalar()?, dest)?;
             }
 
             "getenv" => {