Skip to content

Commit c1a37b8

Browse files
committed
Auto merge of #2298 - InfRandomness:shim-error, r=RalfJung
Add `__error` to freebsd shims Signed-off-by: InfRandomness <[email protected]>
2 parents c768f3c + dc47649 commit c1a37b8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ case $HOST_TARGET in
6060
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
6161
MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
6262
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
63-
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec
63+
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec current_dir_with_isolation
6464
MIRI_TEST_TARGET=thumbv7em-none-eabihf MIRI_NO_STD=1 run_tests_minimal no_std # no_std embedded architecture
6565
;;
6666
x86_64-apple-darwin)

src/shims/unix/freebsd/foreign_items.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
2424
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
2525
this.write_null(dest)?;
2626
}
27+
28+
// errno
29+
"__error" => {
30+
let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
31+
let errno_place = this.last_error_place()?;
32+
this.write_scalar(errno_place.to_ref(this).to_scalar()?, dest)?;
33+
}
34+
2735
_ => return Ok(EmulateByNameResult::NotSupported),
2836
}
2937
Ok(EmulateByNameResult::NeedsJumping)

0 commit comments

Comments
 (0)