-
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
AddValidation: handle Call terminators into blocks that have multiple incoming edges #43748
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
The |
src/librustc_driver/driver.rs
Outdated
@@ -945,11 +945,11 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session, | |||
passes.push_pass(MIR_OPTIMIZED, mir::transform::add_call_guards::AddCallGuards); | |||
passes.push_pass(MIR_OPTIMIZED, mir::transform::elaborate_drops::ElaborateDrops); | |||
passes.push_pass(MIR_OPTIMIZED, mir::transform::no_landing_pads::NoLandingPads); | |||
passes.push_pass(MIR_OPTIMIZED, mir::transform::simplify::SimplifyCfg::new("elaborate-drops")); | |||
// No lifetime analysis based on borrowing can be done from here on out. | |||
|
|||
// AddValidation needs to run after ElaborateDrops and before EraseRegions. |
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.
I think you can replace this patch with a
passes.push_pass(MIR_OPTIMIZED, mir::transform::add_call_guards::AddCallGuards);
Here
Thanks for this hint! I re-did the PR based on that. |
@bors r+ |
📌 Commit 718a8d1 has been approved by |
AddValidation: handle Call terminators into blocks that have multiple incoming edges The old code was just wrong: It would add validation on paths that don't even come from the call, and it would add multiple validations if multiple calls end return to the same block.
☀️ Test successful - status-appveyor, status-travis |
The old code was just wrong: It would add validation on paths that don't even come from the call, and it would add multiple validations if multiple calls end return to the same block.