Skip to content

Commit

Permalink
Rollup merge of rust-lang#72537 - Amanieu:fix-asm-liveness, r=petroch…
Browse files Browse the repository at this point in the history
…enkov

Fix InlineAsmOperand expresions being visited twice during liveness checking
  • Loading branch information
Dylan-DPC authored May 25, 2020
2 parents 8b65235 + be2fd61 commit a919ef4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/librustc_passes/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
_ => {}
}
}
}
Expand Down

0 comments on commit a919ef4

Please sign in to comment.