From 603d2ec72a743de9c0e8603c85d5d9ea98570912 Mon Sep 17 00:00:00 2001 From: "jie.wang" <38901892+jievince@users.noreply.github.com> Date: Thu, 24 Dec 2020 00:19:28 +0800 Subject: [PATCH] fix RewriteMatchLabelVisitor rewriteExprList bug (#504) Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com> --- src/visitor/RewriteMatchLabelVisitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/visitor/RewriteMatchLabelVisitor.cpp b/src/visitor/RewriteMatchLabelVisitor.cpp index 87bbabda..4330f4a9 100644 --- a/src/visitor/RewriteMatchLabelVisitor.cpp +++ b/src/visitor/RewriteMatchLabelVisitor.cpp @@ -141,7 +141,7 @@ RewriteMatchLabelVisitor::rewriteExprList(const std::vector<std::unique_ptr<Expr auto iter = std::find_if(list.cbegin(), list.cend(), [] (auto &expr) { return isLabel(expr.get()); }); - if (iter != list.cend()) { + if (iter == list.cend()) { std::for_each(list.cbegin(), list.cend(), [this] (auto &expr) { const_cast<Expression*>(expr.get())->accept(this); }); -- GitLab