Rollup merge of #72537 - Amanieu:fix-asm-liveness, r=petrochenkov

Fix InlineAsmOperand expresions being visited twice during liveness checking
This commit is contained in:
Ralf Jung 2020-05-25 11:01:07 +02:00 committed by GitHub
commit 14941cfe11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
}
_ => {}
}
}
}