fmt
This commit is contained in:
parent
7a599d758d
commit
b870676432
@ -1030,8 +1030,9 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
|
||||
// <https://github.com/rust-lang/miri/pull/2464#discussion_r939636130> for details.
|
||||
// We avoid `get_ptr_alloc` since we do *not* want to run the access hooks -- the actual
|
||||
// access will happen later.
|
||||
let (alloc_id, _offset, _prov) =
|
||||
this.ptr_try_get_alloc_id(place.ptr()).expect("there are no zero-sized atomic accesses");
|
||||
let (alloc_id, _offset, _prov) = this
|
||||
.ptr_try_get_alloc_id(place.ptr())
|
||||
.expect("there are no zero-sized atomic accesses");
|
||||
if this.get_alloc_mutability(alloc_id)? == Mutability::Not {
|
||||
// FIXME: make this prettier, once these messages have separate title/span/help messages.
|
||||
throw_ub_format!(
|
||||
|
@ -7,8 +7,8 @@ use std::sync::atomic::{AtomicBool, Ordering::Relaxed};
|
||||
use std::task::Poll;
|
||||
use std::time::{Duration, SystemTime};
|
||||
|
||||
use log::trace;
|
||||
use either::Either;
|
||||
use log::trace;
|
||||
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_hir::def_id::DefId;
|
||||
|
@ -159,8 +159,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
||||
|
||||
let arg_type = Ty::new_array(this.tcx.tcx, this.tcx.types.u16, size);
|
||||
let arg_place = this.allocate(this.layout_of(arg_type).unwrap(), memkind)?;
|
||||
let (written, _) =
|
||||
self.write_os_str_to_wide_str(os_str, arg_place.ptr(), size, /*truncate*/ false).unwrap();
|
||||
let (written, _) = self
|
||||
.write_os_str_to_wide_str(os_str, arg_place.ptr(), size, /*truncate*/ false)
|
||||
.unwrap();
|
||||
assert!(written);
|
||||
Ok(arg_place.ptr())
|
||||
}
|
||||
|
@ -112,17 +112,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
||||
// Access to command-line arguments
|
||||
"_NSGetArgc" => {
|
||||
let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
|
||||
this.write_pointer(
|
||||
this.machine.argc.expect("machine must be initialized"),
|
||||
dest,
|
||||
)?;
|
||||
this.write_pointer(this.machine.argc.expect("machine must be initialized"), dest)?;
|
||||
}
|
||||
"_NSGetArgv" => {
|
||||
let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
|
||||
this.write_pointer(
|
||||
this.machine.argv.expect("machine must be initialized"),
|
||||
dest,
|
||||
)?;
|
||||
this.write_pointer(this.machine.argv.expect("machine must be initialized"), dest)?;
|
||||
}
|
||||
"_NSGetExecutablePath" => {
|
||||
let [buf, bufsize] =
|
||||
|
Loading…
x
Reference in New Issue
Block a user