about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2020-05-24 14:26:20 +0100
committerAmanieu d'Antras <amanieu@gmail.com>2020-05-24 14:26:20 +0100
commitbe2fd61d78b815f2d1cb09b0df5f06d73a089ac8 (patch)
tree14daa572f2851b395c048d3fef8ed814179da0ea /src
parent215f2d3294b08dbdcf8f7d40de21ef1e7eae0a2d (diff)
downloadrust-be2fd61d78b815f2d1cb09b0df5f06d73a089ac8.tar.gz
rust-be2fd61d78b815f2d1cb09b0df5f06d73a089ac8.zip
Fix InlineAsmOperand expresions being visited twice during liveness checking
Diffstat (limited to 'src')
-rw-r--r--src/librustc_passes/liveness.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/librustc_passes/liveness.rs b/src/librustc_passes/liveness.rs
index 21512c566e1..2d7562ac1c3 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);
                         }
                     }
+                    _ => {}
                 }
             }
         }