Skip to content

Commit c706f50

Browse files
committed
Auto merge of #1277 - RalfJung:rustup, r=RalfJung
rustup Fix for some renames
2 parents 7a5e95c + f181e75 commit c706f50

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7b73d14b0b35e7b4f79f2d71dc1bbbab31698288
1+
150322f86d441752874a8bed603d71119f190b8b

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
9292
/// Test if this immediate equals 0.
9393
fn is_null(&self, val: Scalar<Tag>) -> InterpResult<'tcx, bool> {
9494
let this = self.eval_context_ref();
95-
let null = Scalar::ptr_null(this);
95+
let null = Scalar::null_ptr(this);
9696
this.ptr_eq(val, null)
9797
}
9898

src/shims/env.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
9898
// The offset is used to strip the "{name}=" part of the string.
9999
Scalar::from(var_ptr.offset(Size::from_bytes(u64::try_from(name.len()).unwrap().checked_add(1).unwrap()), this)?)
100100
}
101-
None => Scalar::ptr_null(&*this.tcx),
101+
None => Scalar::null_ptr(&*this.tcx),
102102
})
103103
}
104104

@@ -305,7 +305,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
305305
}
306306
Err(e) => this.set_last_error_from_io_error(e)?,
307307
}
308-
Ok(Scalar::ptr_null(&*this.tcx))
308+
Ok(Scalar::null_ptr(&*this.tcx))
309309
}
310310

311311
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
343343
// Collect all the pointers to each variable in a vector.
344344
let mut vars: Vec<Scalar<Tag>> = this.machine.env_vars.map.values().map(|&ptr| ptr.into()).collect();
345345
// Add the trailing null pointer.
346-
vars.push(Scalar::ptr_null(this));
346+
vars.push(Scalar::null_ptr(this));
347347
// Make an array with all these pointers inside Miri.
348348
let tcx = this.tcx;
349349
let vars_layout =

src/shims/foreign_items.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
4747
fn malloc(&mut self, size: u64, zero_init: bool, kind: MiriMemoryKind) -> Scalar<Tag> {
4848
let this = self.eval_context_mut();
4949
if size == 0 {
50-
Scalar::ptr_null(this)
50+
Scalar::null_ptr(this)
5151
} else {
5252
let align = this.min_align(size, kind);
5353
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
7878
let new_align = this.min_align(new_size, kind);
7979
if this.is_null(old_ptr)? {
8080
if new_size == 0 {
81-
Ok(Scalar::ptr_null(this))
81+
Ok(Scalar::null_ptr(this))
8282
} else {
8383
let new_ptr =
8484
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
8888
let old_ptr = this.force_ptr(old_ptr)?;
8989
if new_size == 0 {
9090
this.memory.deallocate(old_ptr, None, kind.into())?;
91-
Ok(Scalar::ptr_null(this))
91+
Ok(Scalar::null_ptr(this))
9292
} else {
9393
let new_ptr = this.memory.reallocate(
9494
old_ptr,

src/shims/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
420420

421421
// We cap the number of read bytes to the largest value that we are able to fit in both the
422422
// host's and target's `isize`. This saves us from having to handle overflows later.
423-
let count = count.min(this.isize_max() as u64).min(isize::MAX as u64);
423+
let count = count.min(this.machine_isize_max() as u64).min(isize::MAX as u64);
424424

425425
if let Some(FileHandle { file, writable: _ }) = this.machine.file_handler.handles.get_mut(&fd) {
426426
// 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
474474

475475
// We cap the number of written bytes to the largest value that we are able to fit in both the
476476
// host's and target's `isize`. This saves us from having to handle overflows later.
477-
let count = count.min(this.isize_max() as u64).min(isize::MAX as u64);
477+
let count = count.min(this.machine_isize_max() as u64).min(isize::MAX as u64);
478478

479479
if let Some(FileHandle { file, writable: _ }) = this.machine.file_handler.handles.get_mut(&fd) {
480480
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
860860
}
861861
Err(e) => {
862862
this.set_last_error_from_io_error(e)?;
863-
Ok(Scalar::ptr_null(this))
863+
Ok(Scalar::null_ptr(this))
864864
}
865865
}
866866
}

src/shims/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
7676
let ptr_scalar = this.read_scalar(ptr_op)?.not_undef()?;
7777

7878
// Default: no result.
79-
let mut result = this.usize_max();
79+
let mut result = this.machine_usize_max();
8080
if let Ok(ptr) = this.force_ptr(ptr_scalar) {
8181
// Only do anything if we can identify the allocation this goes to.
8282
let cur_align =

src/shims/tls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'tcx> TlsData<'tcx> {
7777
match self.keys.get(&key) {
7878
Some(&TlsEntry { data, .. }) => {
7979
trace!("TLS key {} loaded: {:?}", key, data);
80-
Ok(data.unwrap_or_else(|| Scalar::ptr_null(cx).into()))
80+
Ok(data.unwrap_or_else(|| Scalar::null_ptr(cx).into()))
8181
}
8282
None => throw_ub_format!("loading from a non-existing TLS key: {}", key),
8383
}
@@ -173,7 +173,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
173173
let ret_place = MPlaceTy::dangling(this.layout_of(this.tcx.mk_unit())?, this).into();
174174
this.call_function(
175175
thread_callback,
176-
&[Scalar::ptr_null(this).into(), reason.into(), Scalar::ptr_null(this).into()],
176+
&[Scalar::null_ptr(this).into(), reason.into(), Scalar::null_ptr(this).into()],
177177
Some(ret_place),
178178
StackPopCleanup::None { cleanup: true },
179179
)?;

0 commit comments

Comments
 (0)