rust/compiler/rustc_const_eval
Michael Goulet b7b2179b5e
Rollup merge of #137802 - RalfJung:miri-native-call-exposed, r=oli-obk
miri native-call support: all previously exposed provenance is accessible to the callee

When Miri invokes a native C function, the memory C can access needs to be "prepared": to avoid false positives, we need to consider all that memory initialized, and we need to consider it to have arbitrary provenance. So far we did this for all pointers passed to C, but not for pointers that were exposed already before the native call. This PR adjusts the logic so that we now "prepare" all memory that has ever been exposed.

This fixes cases such as:
- cast a pointer to integer, send that integer to C, and access the memory there (`test_pass_ptr_as_int`)
- send a pointer to some memory to C, which stores it somewhere; then in Rust store another pointer in that memory, and access that via C (`test_pass_ptr_via_previously_shared_mem`)

r? `````@oli-obk`````
2025-03-06 12:22:18 -05:00
..
src Rollup merge of #137802 - RalfJung:miri-native-call-exposed, r=oli-obk 2025-03-06 12:22:18 -05:00
Cargo.toml Upgrade the compiler to edition 2024 2025-02-22 00:01:48 +00:00
messages.ftl Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00