Auto merge of #1277 - RalfJung:rustup, r=RalfJung

rustup

Fix for some renames
This commit is contained in:
bors 2020-03-29 08:02:10 +00:00
commit c706f50e3f
7 changed files with 14 additions and 14 deletions

View File

@ -1 +1 @@
7b73d14b0b35e7b4f79f2d71dc1bbbab31698288
150322f86d441752874a8bed603d71119f190b8b

View File

@ -92,7 +92,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
/// Test if this immediate equals 0.
fn is_null(&self, val: Scalar<Tag>) -> InterpResult<'tcx, bool> {
let this = self.eval_context_ref();
let null = Scalar::ptr_null(this);
let null = Scalar::null_ptr(this);
this.ptr_eq(val, null)
}

View File

@ -98,7 +98,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
// The offset is used to strip the "{name}=" part of the string.
Scalar::from(var_ptr.offset(Size::from_bytes(u64::try_from(name.len()).unwrap().checked_add(1).unwrap()), this)?)
}
None => Scalar::ptr_null(&*this.tcx),
None => Scalar::null_ptr(&*this.tcx),
})
}
@ -305,7 +305,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}
Err(e) => this.set_last_error_from_io_error(e)?,
}
Ok(Scalar::ptr_null(&*this.tcx))
Ok(Scalar::null_ptr(&*this.tcx))
}
fn chdir(&mut self, path_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx, i32> {
@ -343,7 +343,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
// Collect all the pointers to each variable in a vector.
let mut vars: Vec<Scalar<Tag>> = this.machine.env_vars.map.values().map(|&ptr| ptr.into()).collect();
// Add the trailing null pointer.
vars.push(Scalar::ptr_null(this));
vars.push(Scalar::null_ptr(this));
// Make an array with all these pointers inside Miri.
let tcx = this.tcx;
let vars_layout =

View File

@ -47,7 +47,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
fn malloc(&mut self, size: u64, zero_init: bool, kind: MiriMemoryKind) -> Scalar<Tag> {
let this = self.eval_context_mut();
if size == 0 {
Scalar::ptr_null(this)
Scalar::null_ptr(this)
} else {
let align = this.min_align(size, kind);
let ptr = this.memory.allocate(Size::from_bytes(size), align, kind.into());
@ -78,7 +78,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let new_align = this.min_align(new_size, kind);
if this.is_null(old_ptr)? {
if new_size == 0 {
Ok(Scalar::ptr_null(this))
Ok(Scalar::null_ptr(this))
} else {
let new_ptr =
this.memory.allocate(Size::from_bytes(new_size), new_align, kind.into());
@ -88,7 +88,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let old_ptr = this.force_ptr(old_ptr)?;
if new_size == 0 {
this.memory.deallocate(old_ptr, None, kind.into())?;
Ok(Scalar::ptr_null(this))
Ok(Scalar::null_ptr(this))
} else {
let new_ptr = this.memory.reallocate(
old_ptr,

View File

@ -420,7 +420,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
// We cap the number of read bytes to the largest value that we are able to fit in both the
// host's and target's `isize`. This saves us from having to handle overflows later.
let count = count.min(this.isize_max() as u64).min(isize::MAX as u64);
let count = count.min(this.machine_isize_max() as u64).min(isize::MAX as u64);
if let Some(FileHandle { file, writable: _ }) = this.machine.file_handler.handles.get_mut(&fd) {
// This can never fail because `count` was capped to be smaller than
@ -474,7 +474,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
// We cap the number of written bytes to the largest value that we are able to fit in both the
// host's and target's `isize`. This saves us from having to handle overflows later.
let count = count.min(this.isize_max() as u64).min(isize::MAX as u64);
let count = count.min(this.machine_isize_max() as u64).min(isize::MAX as u64);
if let Some(FileHandle { file, writable: _ }) = this.machine.file_handler.handles.get_mut(&fd) {
let bytes = this.memory.read_bytes(buf, Size::from_bytes(count))?;
@ -860,7 +860,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}
Err(e) => {
this.set_last_error_from_io_error(e)?;
Ok(Scalar::ptr_null(this))
Ok(Scalar::null_ptr(this))
}
}
}

View File

@ -76,7 +76,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let ptr_scalar = this.read_scalar(ptr_op)?.not_undef()?;
// Default: no result.
let mut result = this.usize_max();
let mut result = this.machine_usize_max();
if let Ok(ptr) = this.force_ptr(ptr_scalar) {
// Only do anything if we can identify the allocation this goes to.
let cur_align =

View File

@ -77,7 +77,7 @@ impl<'tcx> TlsData<'tcx> {
match self.keys.get(&key) {
Some(&TlsEntry { data, .. }) => {
trace!("TLS key {} loaded: {:?}", key, data);
Ok(data.unwrap_or_else(|| Scalar::ptr_null(cx).into()))
Ok(data.unwrap_or_else(|| Scalar::null_ptr(cx).into()))
}
None => throw_ub_format!("loading from a non-existing TLS key: {}", key),
}
@ -173,7 +173,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let ret_place = MPlaceTy::dangling(this.layout_of(this.tcx.mk_unit())?, this).into();
this.call_function(
thread_callback,
&[Scalar::ptr_null(this).into(), reason.into(), Scalar::ptr_null(this).into()],
&[Scalar::null_ptr(this).into(), reason.into(), Scalar::null_ptr(this).into()],
Some(ret_place),
StackPopCleanup::None { cleanup: true },
)?;