[clang-tools-extra] 8c4cf23 - Fix crash in InfinteLoopCheck

Nathan James via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 13 12:20:47 PST 2020


Author: Nathan James
Date: 2020-02-13T20:20:37Z
New Revision: 8c4cf23dee1ac3f259c4795b275cc9bb1234aa29

URL: https://github.com/llvm/llvm-project/commit/8c4cf23dee1ac3f259c4795b275cc9bb1234aa29
DIFF: https://github.com/llvm/llvm-project/commit/8c4cf23dee1ac3f259c4795b275cc9bb1234aa29.diff

LOG: Fix crash in InfinteLoopCheck

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 00793009ed39..c9dd47ef0cf9 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 cfe-commits mailing list