Skip to content

Commit 16876c4

Browse files
StrophoxRalfJung
andauthored
Update src/tools/miri/src/shims/native_lib.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent 143e0f1 commit 16876c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tools/miri/src/shims/native_lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ fn imm_to_carg<'tcx>(v: ImmTy<'tcx>, cx: &impl HasDataLayout) -> InterpResult<'t
239239
CArg::USize(v.to_scalar().to_target_usize(cx)?.try_into().unwrap()),
240240
ty::RawPtr(..) => {
241241
let s = v.to_scalar().to_pointer(cx)?.addr();
242-
CArg::RawPtr(s.bytes() as *mut std::ffi::c_void) // TODO
242+
// This relies on the `expose_provenance` in `addr_from_alloc_id`.
243+
CArg::RawPtr(ptr::with_exposed_provenance_mut(s.bytes_usize()))
243244
},
244245
_ => throw_unsup_format!("unsupported argument type for native call: {}", v.layout.ty),
245246
})

0 commit comments

Comments
 (0)