From be2fd61d78b815f2d1cb09b0df5f06d73a089ac8 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Sun, 24 May 2020 14:26:20 +0100 Subject: [PATCH] Fix InlineAsmOperand expresions being visited twice during liveness checking --- src/librustc_passes/liveness.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/librustc_passes/liveness.rs b/src/librustc_passes/liveness.rs index 21512c566e1c..2d7562ac1c34 100644 --- a/src/librustc_passes/liveness.rs +++ b/src/librustc_passes/liveness.rs @@ -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); } } + _ => {} } } }