Skip to content

Commit f08fa81

Browse files
committed
Auto merge of #138366 - matthiaskrgr:rollup-cn16m7q, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #137715 (Allow int literals for pattern types with int base types) - #138002 (Disable CFI for weakly linked syscalls) - #138051 (Add support for downloading GCC from CI) - #138231 (Prevent ICE in autodiff validation by emitting user-friendly errors) - #138245 (stabilize `ci_rustc_if_unchanged_logic` test for local environments) - #138256 (Do not feed anon const a type that references generics that it does not have) - #138284 (Do not write user type annotation for const param value path) - #138296 (Remove `AdtFlags::IS_ANONYMOUS` and `Copy`/`Clone` condition for anonymous ADT) - #138352 (miri native_calls: ensure we actually expose *mutable* provenance to the memory FFI can access) - #138354 (remove redundant `body` arguments) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 857a6c6 + 8df63d8 commit f08fa81

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/alloc_addresses/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
198198
}
199199
AllocKind::Dead => unreachable!(),
200200
};
201-
// Ensure this pointer's provenance is exposed, so that it can be used by FFI code.
202-
return interp_ok(base_ptr.expose_provenance().try_into().unwrap());
201+
// We don't have to expose this pointer yet, we do that in `prepare_for_native_call`.
202+
return interp_ok(base_ptr.addr().try_into().unwrap());
203203
}
204204
// We are not in native lib mode, so we control the addresses ourselves.
205205
if let Some((reuse_addr, clock)) = global_state.reuse.take_addr(

src/shims/native_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ fn imm_to_carg<'tcx>(v: &ImmTy<'tcx>, cx: &impl HasDataLayout) -> InterpResult<'
266266
CArg::USize(v.to_scalar().to_target_usize(cx)?.try_into().unwrap()),
267267
ty::RawPtr(..) => {
268268
let s = v.to_scalar().to_pointer(cx)?.addr();
269-
// This relies on the `expose_provenance` in `addr_from_alloc_id`.
269+
// This relies on the `expose_provenance` in `prepare_for_native_call`.
270270
CArg::RawPtr(std::ptr::with_exposed_provenance_mut(s.bytes_usize()))
271271
}
272272
_ => throw_unsup_format!("unsupported argument type for native call: {}", v.layout.ty),

0 commit comments

Comments
 (0)