Skip to content

Commit

Permalink
Auto merge of #113569 - RalfJung:miri, r=oli-obk
Browse files Browse the repository at this point in the history
miri: protect Move() function arguments during the call

This gives `Move` operands a meaning specific to function calls:
- for the duration of the call, the place the operand comes from is protected, making all read and write accesses insta-UB.
- the contents of that place are reset to `Uninit`, so looking at them again after the function returns, we cannot observe their contents

Turns out we can replace the existing "retag return place" hack with the exact same sort of protection on the return place, which is nicely symmetric.

Fixes rust-lang/rust#112564
Fixes rust-lang/miri#2927

This starts with a Miri rustc-push, since we'd otherwise conflict with a PR that recently landed in Miri.
(The "miri tree borrows" commit is an unrelated cleanup I noticed while doing the PR. I can remove it if you prefer.)
r? `@oli-obk`
  • Loading branch information
bors committed Jul 12, 2023
2 parents eab3aa3 + 10163bd commit 6d99438
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 6d99438

Please sign in to comment.