Skip to content
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

Fix InlineAsmOperand expresions being visited twice during liveness checking #72537

Merged
merged 1 commit into from
May 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix InlineAsmOperand expresions being visited twice during liveness c…
…hecking
Amanieu committed May 24, 2020

Verified

This commit was signed with the committer’s verified signature.
commit be2fd61d78b815f2d1cb09b0df5f06d73a089ac8
10 changes: 2 additions & 8 deletions src/librustc_passes/liveness.rs
Original file line number Diff line number Diff line change
@@ -1460,26 +1460,20 @@ fn check_expr<'tcx>(this: &mut Liveness<'_, 'tcx>, expr: &'tcx Expr<'tcx>) {
hir::ExprKind::InlineAsm(ref asm) => {
for op in asm.operands {
match op {
hir::InlineAsmOperand::In { expr, .. }
| hir::InlineAsmOperand::Const { expr, .. }
| hir::InlineAsmOperand::Sym { expr, .. } => this.visit_expr(expr),
hir::InlineAsmOperand::Out { expr, .. } => {
if let Some(expr) = expr {
this.check_place(expr);
this.visit_expr(expr);
}
}
hir::InlineAsmOperand::InOut { expr, .. } => {
this.check_place(expr);
this.visit_expr(expr);
}
hir::InlineAsmOperand::SplitInOut { in_expr, out_expr, .. } => {
this.visit_expr(in_expr);
hir::InlineAsmOperand::SplitInOut { out_expr, .. } => {
if let Some(out_expr) = out_expr {
this.check_place(out_expr);
this.visit_expr(out_expr);
}
}
_ => {}
}
}
}