commit
416cddb251
@ -1 +1 @@
|
||||
6077b7cda466afa2b75a62b232ab46dbeb148bcb
|
||||
db41351753df840773ca628d8daa040e95d00eef
|
||||
|
@ -631,7 +631,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
|
||||
// Ensure that the access is within bounds.
|
||||
assert!(op_place.layout.size >= offset + layout.size);
|
||||
let value_place = op_place.offset(offset, MemPlaceMeta::None, layout, this)?;
|
||||
let value_place = op_place.offset(offset, layout, this)?;
|
||||
Ok(value_place)
|
||||
}
|
||||
|
||||
|
@ -104,8 +104,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
for (i, ptr) in ptrs.into_iter().enumerate() {
|
||||
let offset = ptr_layout.size * i.try_into().unwrap();
|
||||
|
||||
let op_place =
|
||||
buf_place.offset(offset, MemPlaceMeta::None, ptr_layout, this)?;
|
||||
let op_place = buf_place.offset(offset, ptr_layout, this)?;
|
||||
|
||||
this.write_pointer(ptr, &op_place.into())?;
|
||||
}
|
||||
|
@ -152,23 +152,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
.collect();
|
||||
|
||||
// Set page size.
|
||||
let page_size = system_info.offset(
|
||||
field_offsets[2],
|
||||
MemPlaceMeta::None,
|
||||
dword_layout,
|
||||
&this.tcx,
|
||||
)?;
|
||||
let page_size = system_info.offset(field_offsets[2], dword_layout, &this.tcx)?;
|
||||
this.write_scalar(
|
||||
Scalar::from_int(PAGE_SIZE, dword_layout.size),
|
||||
&page_size.into(),
|
||||
)?;
|
||||
// Set number of processors.
|
||||
let num_cpus = system_info.offset(
|
||||
field_offsets[6],
|
||||
MemPlaceMeta::None,
|
||||
dword_layout,
|
||||
&this.tcx,
|
||||
)?;
|
||||
let num_cpus = system_info.offset(field_offsets[6], dword_layout, &this.tcx)?;
|
||||
this.write_scalar(Scalar::from_int(NUM_CPUS, dword_layout.size), &num_cpus.into())?;
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,10 @@ fn run_tests(mode: Mode, path: &str, target: Option<String>) -> Result<()> {
|
||||
// Less aggressive warnings to make the rustc toolstate management less painful.
|
||||
// (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.)
|
||||
flags.push("-Astable-features".to_owned());
|
||||
flags.push("-Aunused".to_owned());
|
||||
} else {
|
||||
flags.push("-Dwarnings".to_owned());
|
||||
flags.push("-Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
|
||||
flags.push("-Dunused".to_owned());
|
||||
}
|
||||
if let Ok(sysroot) = env::var("MIRI_SYSROOT") {
|
||||
flags.push("--sysroot".to_string());
|
||||
|
@ -3,6 +3,6 @@
|
||||
fn main() {
|
||||
unsafe {
|
||||
let ptr = Box::into_raw(Box::new(0u16));
|
||||
Box::from_raw(ptr as *mut u32);
|
||||
drop(Box::from_raw(ptr as *mut u32));
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,8 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc)
|
||||
note: inside `main` at $DIR/issue-miri-1050-1.rs:LL:CC
|
||||
--> $DIR/issue-miri-1050-1.rs:LL:CC
|
||||
|
|
||||
LL | Box::from_raw(ptr as *mut u32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | drop(Box::from_raw(ptr as *mut u32));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
@ -4,6 +4,6 @@ use std::ptr::NonNull;
|
||||
fn main() {
|
||||
unsafe {
|
||||
let ptr = NonNull::<i32>::dangling();
|
||||
Box::from_raw(ptr.as_ptr());
|
||||
drop(Box::from_raw(ptr.as_ptr()));
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,8 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc)
|
||||
note: inside `main` at $DIR/issue-miri-1050-2.rs:LL:CC
|
||||
--> $DIR/issue-miri-1050-2.rs:LL:CC
|
||||
|
|
||||
LL | Box::from_raw(ptr.as_ptr());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | drop(Box::from_raw(ptr.as_ptr()));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user