Skip to content

Commit 7d58865

Browse files
committed
rename deref_operand → deref_pointer and some Miri helper functions
1 parent 866710c commit 7d58865

25 files changed

+84
-85
lines changed

compiler/rustc_const_eval/src/const_eval/machine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> {
214214
// &str or &&str
215215
assert!(args.len() == 1);
216216

217-
let mut msg_place = self.deref_operand(&args[0])?;
217+
let mut msg_place = self.deref_pointer(&args[0])?;
218218
while msg_place.layout.ty.is_ref() {
219-
msg_place = self.deref_operand(&msg_place)?;
219+
msg_place = self.deref_pointer(&msg_place)?;
220220
}
221221

222222
let msg = Symbol::intern(self.read_str(&msg_place)?);

compiler/rustc_const_eval/src/const_eval/valtrees.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub(crate) fn const_to_valtree_inner<'tcx>(
102102
ty::FnPtr(_) | ty::RawPtr(_) => Err(ValTreeCreationError::NonSupportedType),
103103

104104
ty::Ref(_, _, _) => {
105-
let Ok(derefd_place)= ecx.deref_operand(place) else {
105+
let Ok(derefd_place)= ecx.deref_pointer(place) else {
106106
return Err(ValTreeCreationError::Other);
107107
};
108108
debug!(?derefd_place);

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
144144
}
145145

146146
sym::min_align_of_val | sym::size_of_val => {
147-
// Avoid `deref_operand` -- this is not a deref, the ptr does not have to be
147+
// Avoid `deref_pointer` -- this is not a deref, the ptr does not have to be
148148
// dereferenceable!
149149
let place = self.ref_to_mplace(&self.read_immediate(&args[0])?)?;
150150
let (size, align) = self
@@ -225,7 +225,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
225225
self.write_scalar(val, dest)?;
226226
}
227227
sym::discriminant_value => {
228-
let place = self.deref_operand(&args[0])?;
228+
let place = self.deref_pointer(&args[0])?;
229229
let variant = self.read_discriminant(&place)?;
230230
let discr = self.discriminant_for_variant(place.layout, variant)?;
231231
self.write_scalar(discr, dest)?;

compiler/rustc_const_eval/src/interpret/place.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ where
419419
///
420420
/// Only call this if you are sure the place is "valid" (aligned and inbounds), or do not
421421
/// want to ever use the place for memory access!
422-
/// Generally prefer `deref_operand`.
422+
/// Generally prefer `deref_pointer`.
423423
pub fn ref_to_mplace(
424424
&self,
425425
val: &ImmTy<'tcx, M::Provenance>,
@@ -439,8 +439,9 @@ where
439439
}
440440

441441
/// Take an operand, representing a pointer, and dereference it to a place.
442+
/// Corresponds to the `*` operator in Rust.
442443
#[instrument(skip(self), level = "debug")]
443-
pub fn deref_operand(
444+
pub fn deref_pointer(
444445
&self,
445446
src: &impl Readable<'tcx, M::Provenance>,
446447
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::Provenance>> {

compiler/rustc_const_eval/src/interpret/projection.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ where
290290
OpaqueCast(ty) => base.transmute(self.layout_of(ty)?, self)?,
291291
Field(field, _) => self.project_field(base, field.index())?,
292292
Downcast(_, variant) => self.project_downcast(base, variant)?,
293-
Deref => self.deref_operand(&base.to_op(self)?)?.into(),
293+
Deref => self.deref_pointer(&base.to_op(self)?)?.into(),
294294
Index(local) => {
295295
let layout = self.layout_of(self.tcx.types.usize)?;
296296
let n = self.local_to_op(self.frame(), local, Some(layout))?;

compiler/rustc_const_eval/src/interpret/terminator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
661661
let receiver_place = loop {
662662
match receiver.layout.ty.kind() {
663663
ty::Ref(..) | ty::RawPtr(..) => {
664-
// We do *not* use `deref_operand` here: we don't want to conceptually
664+
// We do *not* use `deref_pointer` here: we don't want to conceptually
665665
// create a place that must be dereferenceable, since the receiver might
666666
// be a raw pointer and (for `*const dyn Trait`) we don't need to
667667
// actually access memory to resolve this method.

compiler/rustc_const_eval/src/interpret/validity.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
345345
value: &OpTy<'tcx, M::Provenance>,
346346
ptr_kind: PointerKind,
347347
) -> InterpResult<'tcx> {
348+
// Not using `deref_pointer` since we do the dereferenceable check ourselves below.
348349
let place = self.ecx.ref_to_mplace(&self.read_immediate(value, ptr_kind.into())?)?;
349350
// Handle wide pointers.
350351
// Check metadata early, for better diagnostics
@@ -515,9 +516,6 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
515516
Ok(true)
516517
}
517518
ty::RawPtr(..) => {
518-
// We are conservative with uninit for integers, but try to
519-
// actually enforce the strict rules for raw pointers (mostly because
520-
// that lets us re-use `ref_to_mplace`).
521519
let place =
522520
self.ecx.ref_to_mplace(&self.read_immediate(value, ExpectedKind::RawPtr)?)?;
523521
if place.layout.is_unsized() {

src/tools/miri/src/concurrency/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub(super) trait EvalContextExtPriv<'mir, 'tcx: 'mir>:
206206
) -> InterpResult<'tcx, Option<Id>> {
207207
let this = self.eval_context_mut();
208208
let value_place =
209-
this.deref_operand_and_offset(lock_op, offset, lock_layout, this.machine.layouts.u32)?;
209+
this.deref_pointer_and_offset(lock_op, offset, lock_layout, this.machine.layouts.u32)?;
210210

211211
// Since we are lazy, this update has to be atomic.
212212
let (old, success) = this

src/tools/miri/src/helpers.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
715715
}
716716

717717
/// Dereference a pointer operand to a place using `layout` instead of the pointer's declared type
718-
fn deref_operand_as(
718+
fn deref_pointer_as(
719719
&self,
720-
op: &OpTy<'tcx, Provenance>,
720+
op: &impl Readable<'tcx, Provenance>,
721721
layout: TyAndLayout<'tcx>,
722722
) -> InterpResult<'tcx, MPlaceTy<'tcx, Provenance>> {
723723
let this = self.eval_context_ref();
@@ -746,15 +746,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
746746
}
747747

748748
/// Calculates the MPlaceTy given the offset and layout of an access on an operand
749-
fn deref_operand_and_offset(
749+
fn deref_pointer_and_offset(
750750
&self,
751-
op: &OpTy<'tcx, Provenance>,
751+
op: &impl Readable<'tcx, Provenance>,
752752
offset: u64,
753753
base_layout: TyAndLayout<'tcx>,
754754
value_layout: TyAndLayout<'tcx>,
755755
) -> InterpResult<'tcx, MPlaceTy<'tcx, Provenance>> {
756756
let this = self.eval_context_ref();
757-
let op_place = this.deref_operand_as(op, base_layout)?;
757+
let op_place = this.deref_pointer_as(op, base_layout)?;
758758
let offset = Size::from_bytes(offset);
759759

760760
// Ensure that the access is within bounds.
@@ -763,28 +763,28 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
763763
Ok(value_place)
764764
}
765765

766-
fn read_scalar_at_offset(
766+
fn deref_pointer_and_read(
767767
&self,
768-
op: &OpTy<'tcx, Provenance>,
768+
op: &impl Readable<'tcx, Provenance>,
769769
offset: u64,
770770
base_layout: TyAndLayout<'tcx>,
771771
value_layout: TyAndLayout<'tcx>,
772772
) -> InterpResult<'tcx, Scalar<Provenance>> {
773773
let this = self.eval_context_ref();
774-
let value_place = this.deref_operand_and_offset(op, offset, base_layout, value_layout)?;
774+
let value_place = this.deref_pointer_and_offset(op, offset, base_layout, value_layout)?;
775775
this.read_scalar(&value_place)
776776
}
777777

778-
fn write_scalar_at_offset(
778+
fn deref_pointer_and_write(
779779
&mut self,
780-
op: &OpTy<'tcx, Provenance>,
780+
op: &impl Readable<'tcx, Provenance>,
781781
offset: u64,
782782
value: impl Into<Scalar<Provenance>>,
783783
base_layout: TyAndLayout<'tcx>,
784784
value_layout: TyAndLayout<'tcx>,
785785
) -> InterpResult<'tcx, ()> {
786786
let this = self.eval_context_mut();
787-
let value_place = this.deref_operand_and_offset(op, offset, base_layout, value_layout)?;
787+
let value_place = this.deref_pointer_and_offset(op, offset, base_layout, value_layout)?;
788788
this.write_scalar(value, &value_place)
789789
}
790790

src/tools/miri/src/shims/backtrace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
9797
1 => {
9898
let [_flags, buf] = this.check_shim(abi, Abi::Rust, link_name, args)?;
9999

100-
let buf_place = this.deref_operand(buf)?;
100+
let buf_place = this.deref_pointer(buf)?;
101101

102102
let ptr_layout = this.layout_of(ptr_ty)?;
103103

src/tools/miri/src/shims/foreign_items.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
418418
// // First thing: load all the arguments. Details depend on the shim.
419419
// let arg1 = this.read_scalar(arg1)?.to_u32()?;
420420
// let arg2 = this.read_pointer(arg2)?; // when you need to work with the pointer directly
421-
// let arg3 = this.deref_operand_as(arg3, this.libc_ty_layout("some_libc_struct"))?; // when you want to load/store
421+
// let arg3 = this.deref_pointer_as(arg3, this.libc_ty_layout("some_libc_struct"))?; // when you want to load/store
422422
// // through the pointer and supply the type information yourself
423-
// let arg4 = this.deref_operand(arg4)?; // when you want to load/store through the pointer and trust
423+
// let arg4 = this.deref_pointer(arg4)?; // when you want to load/store through the pointer and trust
424424
// // the user-given type (which you shouldn't usually do)
425425
//
426426
// // ...

src/tools/miri/src/shims/intrinsics/atomic.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
130130
let this = self.eval_context_mut();
131131

132132
let [place] = check_arg_count(args)?;
133-
let place = this.deref_operand(place)?;
133+
let place = this.deref_pointer(place)?;
134134

135135
// Perform atomic load.
136136
let val = this.read_scalar_atomic(&place, atomic)?;
@@ -147,7 +147,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
147147
let this = self.eval_context_mut();
148148

149149
let [place, val] = check_arg_count(args)?;
150-
let place = this.deref_operand(place)?;
150+
let place = this.deref_pointer(place)?;
151151

152152
// Perform regular load.
153153
let val = this.read_scalar(val)?;
@@ -188,7 +188,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
188188
let this = self.eval_context_mut();
189189

190190
let [place, rhs] = check_arg_count(args)?;
191-
let place = this.deref_operand(place)?;
191+
let place = this.deref_pointer(place)?;
192192
let rhs = this.read_immediate(rhs)?;
193193

194194
if !place.layout.ty.is_integral() && !place.layout.ty.is_unsafe_ptr() {
@@ -229,7 +229,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
229229
let this = self.eval_context_mut();
230230

231231
let [place, new] = check_arg_count(args)?;
232-
let place = this.deref_operand(place)?;
232+
let place = this.deref_pointer(place)?;
233233
let new = this.read_scalar(new)?;
234234

235235
let old = this.atomic_exchange_scalar(&place, new, atomic)?;
@@ -248,7 +248,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
248248
let this = self.eval_context_mut();
249249

250250
let [place, expect_old, new] = check_arg_count(args)?;
251-
let place = this.deref_operand(place)?;
251+
let place = this.deref_pointer(place)?;
252252
let expect_old = this.read_immediate(expect_old)?; // read as immediate for the sake of `binary_op()`
253253
let new = this.read_scalar(new)?;
254254

src/tools/miri/src/shims/intrinsics/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
9696
// Raw memory accesses
9797
"volatile_load" => {
9898
let [place] = check_arg_count(args)?;
99-
let place = this.deref_operand(place)?;
99+
let place = this.deref_pointer(place)?;
100100
this.copy_op(&place, dest, /*allow_transmute*/ false)?;
101101
}
102102
"volatile_store" => {
103103
let [place, dest] = check_arg_count(args)?;
104-
let place = this.deref_operand(place)?;
104+
let place = this.deref_pointer(place)?;
105105
this.copy_op(dest, &place, /*allow_transmute*/ false)?;
106106
}
107107

src/tools/miri/src/shims/intrinsics/simd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
534534
let dest = this.project_index(&dest, i)?;
535535

536536
let val = if simd_element_to_bool(mask)? {
537-
let place = this.deref_operand(&ptr)?;
537+
let place = this.deref_pointer(&ptr)?;
538538
this.read_immediate(&place)?
539539
} else {
540540
passthru
@@ -557,7 +557,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
557557
let mask = this.read_immediate(&this.project_index(&mask, i)?)?;
558558

559559
if simd_element_to_bool(mask)? {
560-
let place = this.deref_operand(&ptr)?;
560+
let place = this.deref_pointer(&ptr)?;
561561
this.write_immediate(*value, &place)?;
562562
}
563563
}

src/tools/miri/src/shims/time.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
2525
this.assert_target_os_is_unix("clock_gettime");
2626

2727
let clk_id = this.read_scalar(clk_id_op)?.to_i32()?;
28-
let tp = this.deref_operand_as(tp_op, this.libc_ty_layout("timespec"))?;
28+
let tp = this.deref_pointer_as(tp_op, this.libc_ty_layout("timespec"))?;
2929

3030
let absolute_clocks;
3131
let mut relative_clocks;
@@ -92,7 +92,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
9292
this.assert_target_os_is_unix("gettimeofday");
9393
this.check_no_isolation("`gettimeofday`")?;
9494

95-
let tv = this.deref_operand_as(tv_op, this.libc_ty_layout("timeval"))?;
95+
let tv = this.deref_pointer_as(tv_op, this.libc_ty_layout("timeval"))?;
9696

9797
// Using tz is obsolete and should always be null
9898
let tz = this.read_pointer(tz_op)?;
@@ -121,7 +121,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
121121
this.assert_target_os("windows", "GetSystemTimeAsFileTime");
122122
this.check_no_isolation("`GetSystemTimeAsFileTime`")?;
123123

124-
let filetime = this.deref_operand_as(LPFILETIME_op, this.windows_ty_layout("FILETIME"))?;
124+
let filetime = this.deref_pointer_as(LPFILETIME_op, this.windows_ty_layout("FILETIME"))?;
125125

126126
let NANOS_PER_SEC = this.eval_windows_u64("time", "NANOS_PER_SEC");
127127
let INTERVALS_PER_SEC = this.eval_windows_u64("time", "INTERVALS_PER_SEC");
@@ -156,7 +156,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
156156
let qpc = i64::try_from(duration.as_nanos()).map_err(|_| {
157157
err_unsup_format!("programs running longer than 2^63 nanoseconds are not supported")
158158
})?;
159-
this.write_scalar(Scalar::from_i64(qpc), &this.deref_operand(lpPerformanceCount_op)?)?;
159+
this.write_scalar(Scalar::from_i64(qpc), &this.deref_pointer(lpPerformanceCount_op)?)?;
160160
Ok(Scalar::from_i32(-1)) // return non-zero on success
161161
}
162162

@@ -176,7 +176,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
176176
// and thus 10^9 counts per second.
177177
this.write_scalar(
178178
Scalar::from_i64(1_000_000_000),
179-
&this.deref_operand_as(lpFrequency_op, this.machine.layouts.u64)?,
179+
&this.deref_pointer_as(lpFrequency_op, this.machine.layouts.u64)?,
180180
)?;
181181
Ok(Scalar::from_i32(-1)) // Return non-zero on success
182182
}
@@ -203,7 +203,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
203203

204204
this.assert_target_os("macos", "mach_timebase_info");
205205

206-
let info = this.deref_operand_as(info_op, this.libc_ty_layout("mach_timebase_info"))?;
206+
let info = this.deref_pointer_as(info_op, this.libc_ty_layout("mach_timebase_info"))?;
207207

208208
// Since our emulated ticks in `mach_absolute_time` *are* nanoseconds,
209209
// no scaling needs to happen.
@@ -222,7 +222,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
222222

223223
this.assert_target_os_is_unix("nanosleep");
224224

225-
let req = this.deref_operand_as(req_op, this.libc_ty_layout("timespec"))?;
225+
let req = this.deref_pointer_as(req_op, this.libc_ty_layout("timespec"))?;
226226

227227
let duration = match this.read_timespec(&req)? {
228228
Some(duration) => duration,

src/tools/miri/src/shims/unix/foreign_items.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
191191
// Allocation
192192
"posix_memalign" => {
193193
let [ret, align, size] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
194-
let ret = this.deref_operand(ret)?;
194+
let ret = this.deref_pointer(ret)?;
195195
let align = this.read_target_usize(align)?;
196196
let size = this.read_target_usize(size)?;
197197
// Align must be power of 2, and also at least ptr-sized (POSIX rules).
@@ -271,7 +271,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
271271
// Thread-local storage
272272
"pthread_key_create" => {
273273
let [key, dtor] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
274-
let key_place = this.deref_operand_as(key, this.libc_ty_layout("pthread_key_t"))?;
274+
let key_place = this.deref_pointer_as(key, this.libc_ty_layout("pthread_key_t"))?;
275275
let dtor = this.read_pointer(dtor)?;
276276

277277
// Extract the function type out of the signature (that seems easier than constructing it ourselves).
@@ -506,7 +506,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
506506
"pthread_attr_getguardsize"
507507
if this.frame_in_std() => {
508508
let [_attr, guard_size] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
509-
let guard_size = this.deref_operand(guard_size)?;
509+
let guard_size = this.deref_pointer(guard_size)?;
510510
let guard_size_layout = this.libc_ty_layout("size_t");
511511
this.write_scalar(Scalar::from_uint(this.machine.page_size, guard_size_layout.size), &guard_size)?;
512512

@@ -532,9 +532,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
532532
// Hence we can mostly ignore the input `attr_place`.
533533
let [attr_place, addr_place, size_place] =
534534
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
535-
let _attr_place = this.deref_operand_as(attr_place, this.libc_ty_layout("pthread_attr_t"))?;
536-
let addr_place = this.deref_operand(addr_place)?;
537-
let size_place = this.deref_operand(size_place)?;
535+
let _attr_place = this.deref_pointer_as(attr_place, this.libc_ty_layout("pthread_attr_t"))?;
536+
let addr_place = this.deref_pointer(addr_place)?;
537+
let size_place = this.deref_pointer(size_place)?;
538538

539539
this.write_scalar(
540540
Scalar::from_uint(this.machine.stack_addr, this.pointer_size()),
@@ -575,10 +575,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
575575
this.check_no_isolation("`getpwuid_r`")?;
576576

577577
let uid = this.read_scalar(uid)?.to_u32()?;
578-
let pwd = this.deref_operand_as(pwd, this.libc_ty_layout("passwd"))?;
578+
let pwd = this.deref_pointer_as(pwd, this.libc_ty_layout("passwd"))?;
579579
let buf = this.read_pointer(buf)?;
580580
let buflen = this.read_target_usize(buflen)?;
581-
let result = this.deref_operand(result)?;
581+
let result = this.deref_pointer(result)?;
582582

583583
// Must be for "us".
584584
if uid != crate::shims::unix::UID {

0 commit comments

Comments
 (0)