Fix MIR inlining of asm_unwind#102778
Merged
bors merged 2 commits intorust-lang:masterfrom Oct 8, 2022
Merged
Conversation
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Contributor
|
Thanks! |
Contributor
|
@bors r+ |
Collaborator
Contributor
|
@bors delegate=nbdd0121 |
Collaborator
|
✌️ @nbdd0121 can now approve this pull request |
Member
Author
|
@bors r=tmiasko |
Collaborator
|
📌 Commit 18a1de0836cb5ceae21b0578bfba029404617c97 has been approved by It is now in the queue for this repository. |
This comment has been minimized.
This comment has been minimized.
Member
Author
|
@bors r=tmiasko |
Collaborator
Member
|
I believe |
Member
Author
|
That's correct. |
Member
|
Great, thank you! 🙂 |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Oct 8, 2022
Fix MIR inlining of asm_unwind
The MIR inlining currently doesn't handle inline asm's unwind edge correctly.
This code will cause ICE:
```rust
struct D;
impl Drop for D {
fn drop(&mut self) {}
}
#[inline(always)]
fn foo() {
let _d = D;
unsafe { std::arch::asm!("", options(may_unwind)) };
}
pub fn main() {
foo();
}
```
This PR fixes this issue. I also take the opportunity to extract common code into a method.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 8, 2022
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#101520 (Allow transmutes between the same types after erasing lifetimes) - rust-lang#102675 (Remove `mir::CastKind::Misc`) - rust-lang#102778 (Fix MIR inlining of asm_unwind) - rust-lang#102785 (Remove `DefId` from some `SelectionCandidate` variants) - rust-lang#102788 (Update rustc-dev-guide) - rust-lang#102789 (Update browser UI test version) - rust-lang#102797 (rustdoc: remove no-op CSS `.rightside { position: initial }`) - rust-lang#102798 (rustdoc: add main-heading and example-wrap link CSS to big selector) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The MIR inlining currently doesn't handle inline asm's unwind edge correctly.
This code will cause ICE:
This PR fixes this issue. I also take the opportunity to extract common code into a method.