-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweak the way we protect in-place function arguments in interpreters #122076
Conversation
The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
|
||
if let Either::Left(destination) = destination.as_mplace_or_local() { | ||
// Protect return place for in-place return value passing. | ||
M::protect_in_place_function_argument(self, &destination)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This becomes cleaner once #121985 lands.
The solution seems to be what is described in #122076 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! r=me with nits fixed.
519582a
to
ede955a
Compare
☔ The latest upstream changes (presumably #121985) made this pull request unmergeable. Please resolve the merge conflicts. |
ede955a
to
5c5f496
Compare
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#118623 (Improve std::fs::read_to_string example) - rust-lang#119365 (Add asm goto support to `asm!`) - rust-lang#120608 (Docs for std::ptr::slice_from_raw_parts) - rust-lang#121885 (Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attribute to inner type.) - rust-lang#121938 (Fix quadratic behavior of repeated vectored writes) - rust-lang#122099 (Add `#[inline]` to `BTreeMap::new` constructor) - rust-lang#122143 (PassWrapper: update for llvm/llvm-project@a3319371970b) Failed merges: - rust-lang#122076 (Tweak the way we protect in-place function arguments in interpreters) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#118623 (Improve std::fs::read_to_string example) - rust-lang#119365 (Add asm goto support to `asm!`) - rust-lang#120608 (Docs for std::ptr::slice_from_raw_parts) - rust-lang#121832 (Add new Tier-3 target: `loongarch64-unknown-linux-musl`) - rust-lang#121938 (Fix quadratic behavior of repeated vectored writes) - rust-lang#122099 (Add `#[inline]` to `BTreeMap::new` constructor) - rust-lang#122103 (Make TAITs and ATPITs capture late-bound lifetimes in scope) - rust-lang#122143 (PassWrapper: update for llvm/llvm-project@a3319371970b) Failed merges: - rust-lang#122076 (Tweak the way we protect in-place function arguments in interpreters) r? `@ghost` `@rustbot` modify labels: rollup
☔ The latest upstream changes (presumably #122182) made this pull request unmergeable. Please resolve the merge conflicts. |
Use `MPlaceTy` instead of `PlaceTy` in `FnArg` and ignore (copy) locals in an earlier step ("Locals that don't have their address taken are as protected as they can ever be"). This seems to be crucial for tail call support (as they can't refer to caller's locals which are killed when replacing the stack frame).
5c5f496
to
a984322
Compare
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#121025 (add known-bug tests for derive failure to detect packed repr) - rust-lang#121194 (Refactor pre-getopts command line argument handling) - rust-lang#121563 (Use `ControlFlow` in visitors.) - rust-lang#122173 (Don't ICE in CTFE if raw/fn-ptr types differ) - rust-lang#122175 (Bless tidy issues order) - rust-lang#122179 (rustc: Fix typo) - rust-lang#122181 (Fix crash in internal late lint checking) - rust-lang#122183 (interpret: update comment about read_discriminant on uninhabited variants) Failed merges: - rust-lang#122076 (Tweak the way we protect in-place function arguments in interpreters) - rust-lang#122132 (Diagnostic renaming 3) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#121025 (add known-bug tests for derive failure to detect packed repr) - rust-lang#121194 (Refactor pre-getopts command line argument handling) - rust-lang#121563 (Use `ControlFlow` in visitors.) - rust-lang#122173 (Don't ICE in CTFE if raw/fn-ptr types differ) - rust-lang#122175 (Bless tidy issues order) - rust-lang#122179 (rustc: Fix typo) - rust-lang#122181 (Fix crash in internal late lint checking) - rust-lang#122183 (interpret: update comment about read_discriminant on uninhabited variants) Failed merges: - rust-lang#122076 (Tweak the way we protect in-place function arguments in interpreters) - rust-lang#122132 (Diagnostic renaming 3) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#121201 (align_offset, align_to: no longer allow implementations to spuriously fail to align) - rust-lang#122076 (Tweak the way we protect in-place function arguments in interpreters) - rust-lang#122100 (Better comment for implicit captures in RPITIT) - rust-lang#122157 (Add the new description field to Target::to_json, and add descriptions for some MSVC targets) - rust-lang#122164 (Fix misaligned loads when loading UEFI arg pointers) - rust-lang#122171 (Add some new solver tests) - rust-lang#122172 (Don't ICE if we collect no RPITITs unless there are no unification errors) - rust-lang#122197 (inspect formatter: add braces) - rust-lang#122198 (Remove handling for previously dropped LLVM version) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122076 - WaffleLapkin:mplace-args, r=RalfJung Tweak the way we protect in-place function arguments in interpreters Use `MPlaceTy` instead of `PlaceTy` in `FnArg` and ignore (copy) locals in an earlier step ("Locals that don't have their address taken are as protected as they can ever be"). This seems to be crucial for tail call support (as they can't refer to caller's locals which are killed when replacing the stack frame). r? `@RalfJung` cc `@oli-obk` see rust-lang#121273 (comment)
Use
MPlaceTy
instead ofPlaceTy
inFnArg
and ignore (copy) locals in an earlier step ("Locals that don't have their address taken are as protected as they can ever be").This seems to be crucial for tail call support (as they can't refer to caller's locals which are killed when replacing the stack frame).
r? @RalfJung
cc @oli-obk
see #121273 (comment)