Skip to content

Commit 5a0499d

Browse files
authored
Merge pull request #4445 from RalfJung/rustup
Rustup
2 parents d9afd0f + 73ff773 commit 5a0499d

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
837c5dd7de03aa97190593aef4e70d53e1bb574b
1+
733b47ea4b1b86216f14ef56e49440c33933f230

src/shims/extern_static.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Provides the `extern static` that this platform expects.
22
3-
use rustc_symbol_mangling::mangle_internal_symbol;
4-
53
use crate::*;
64

75
impl<'tcx> MiriMachine<'tcx> {
@@ -45,15 +43,6 @@ impl<'tcx> MiriMachine<'tcx> {
4543

4644
/// Sets up the "extern statics" for this machine.
4745
pub fn init_extern_statics(ecx: &mut MiriInterpCx<'tcx>) -> InterpResult<'tcx> {
48-
// "__rust_alloc_error_handler_should_panic"
49-
let val = ecx.tcx.sess.opts.unstable_opts.oom.should_panic();
50-
let val = ImmTy::from_int(val, ecx.machine.layouts.u8);
51-
Self::alloc_extern_static(
52-
ecx,
53-
&mangle_internal_symbol(*ecx.tcx, "__rust_alloc_error_handler_should_panic"),
54-
val,
55-
)?;
56-
5746
if ecx.target_os_is_unix() {
5847
// "environ" is mandated by POSIX.
5948
let environ = ecx.machine.env_vars.unix().environ();

src/shims/foreign_items.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,14 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
615615
// This is a no-op shim that only exists to prevent making the allocator shims instantly stable.
616616
let [] = this.check_shim(abi, CanonAbi::Rust, link_name, args)?;
617617
}
618+
name if name
619+
== this.mangle_internal_symbol("__rust_alloc_error_handler_should_panic_v2") =>
620+
{
621+
// Gets the value of the `oom` option.
622+
let [] = this.check_shim(abi, CanonAbi::Rust, link_name, args)?;
623+
let val = this.tcx.sess.opts.unstable_opts.oom.should_panic();
624+
this.write_int(val, dest)?;
625+
}
618626

619627
// C memory handling functions
620628
"memcmp" => {

tests/pass/alloc-access-tracking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![no_std]
22
#![no_main]
3-
//@compile-flags: -Zmiri-track-alloc-id=21 -Zmiri-track-alloc-accesses -Cpanic=abort
4-
//@normalize-stderr-test: "id 21" -> "id $$ALLOC"
3+
//@compile-flags: -Zmiri-track-alloc-id=20 -Zmiri-track-alloc-accesses -Cpanic=abort
4+
//@normalize-stderr-test: "id 20" -> "id $$ALLOC"
55
//@only-target: linux # alloc IDs differ between OSes (due to extern static allocations)
66

77
extern "Rust" {

0 commit comments

Comments
 (0)