[llvm-branch-commits] [clang-tools-extra] 0cffa93 - Fix crash in InfinteLoopCheck

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 17 04:02:15 PST 2020


Author: Nathan James
Date: 2020-02-17T13:01:23+01:00
New Revision: 0cffa939a7d8af8a3b62ec790bf02066b4568e53

URL: https://github.com/llvm/llvm-project/commit/0cffa939a7d8af8a3b62ec790bf02066b4568e53
DIFF: https://github.com/llvm/llvm-project/commit/0cffa939a7d8af8a3b62ec790bf02066b4568e53.diff

LOG: Fix crash in InfinteLoopCheck

(cherry picked from commit 8c4cf23dee1ac3f259c4795b275cc9bb1234aa29)

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp
index 5e5651fc256e..bcdb445948d9 100644
--- a/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp
@@ -153,6 +153,8 @@ static std::string getCondVarNames(const Stmt *Cond) {
 }
 
 static bool isKnownFalse(const Expr &Cond, const ASTContext &Ctx) {
+  if (Cond.isValueDependent())
+    return false;
   bool Result = false;
   if (Cond.EvaluateAsBooleanCondition(Result, Ctx))
     return !Result;


        


More information about the llvm-branch-commits mailing list