diff options
| author | Ralf Jung <post@ralfj.de> | 2020-05-25 11:01:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-25 11:01:07 +0200 |
| commit | 14941cfe1116be6581718fef7437bff8f62d1aad (patch) | |
| tree | b5cb15b527793a1545f0b4eff236c31c8d3ea7ca | |
| parent | 4a5a6559d315559d18c90442d1203f1e73ae8960 (diff) | |
| parent | be2fd61d78b815f2d1cb09b0df5f06d73a089ac8 (diff) | |
| download | rust-14941cfe1116be6581718fef7437bff8f62d1aad.tar.gz rust-14941cfe1116be6581718fef7437bff8f62d1aad.zip | |
Rollup merge of #72537 - Amanieu:fix-asm-liveness, r=petrochenkov
Fix InlineAsmOperand expresions being visited twice during liveness checking
| -rw-r--r-- | src/librustc_passes/liveness.rs | 10 |
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); } } + _ => {} } } } |
