diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-08-31 20:36:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-31 20:36:25 +0200 |
| commit | a5fb8b90bf7c72e4c29dc1991f47b679de76d499 (patch) | |
| tree | d5e9ca23ee59d9a0525db4e1632ebd1d070a4768 /compiler/rustc_codegen_llvm/src | |
| parent | e3795af77f6389b3ef5f54981abe435a9c1f0b44 (diff) | |
| parent | 7fde02ea53f423ca25740e9339d8ff1db8f73052 (diff) | |
| download | rust-a5fb8b90bf7c72e4c29dc1991f47b679de76d499.tar.gz rust-a5fb8b90bf7c72e4c29dc1991f47b679de76d499.zip | |
Rollup merge of #129684 - Strophox:miri-pass-pointer-to-ffi, r=RalfJung
Enable Miri to pass pointers through FFI
Following https://github.com/rust-lang/rust/pull/126787, the purpose of this PR is to now enable Miri to execute native calls that make use of pointers.
> <details>
>
> <summary> Simple example </summary>
>
> ```rust
> extern "C" {
> fn ptr_printer(ptr: *mut i32);
> }
>
> fn main() {
> let ptr = &mut 42 as *mut i32;
> unsafe {
> ptr_printer(ptr);
> }
> }
> ```
> ```c
> void ptr_printer(int *ptr) {
> printf("printing pointer dereference from C: %d\n", *ptr);
> }
> ```
> should now show `printing pointer dereference from C: 42`.
>
> </details>
Note that this PR does not yet implement any logic involved in updating Miri's "analysis" state (byte initialization, provenance) upon such a native call.
r? ``@RalfJung``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
