r335030 - [analyzer] Made a buildbot happy.

Kristof Umann via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 19 01:35:02 PDT 2018


Author: szelethus
Date: Tue Jun 19 01:35:02 2018
New Revision: 335030

URL: http://llvm.org/viewvc/llvm-project?rev=335030&view=rev
Log:
[analyzer] Made a buildbot happy.

Since `isPrimitiveType` was only used in an assert, a builbot with `-Werror`
and no asserts enabled failed to build it as it was unused.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp?rev=335030&r1=335029&r2=335030&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp Tue Jun 19 01:35:02 2018
@@ -384,15 +384,17 @@ bool FindUninitializedFields::isNonUnion
       continue;
     }
 
-    assert(isPrimitiveType(T) && "Non-primitive type! "
-                                 "At this point FR must be primitive!");
+    if (isPrimitiveType(T)) {
+      SVal V = State->getSVal(FieldVal);
 
-    SVal V = State->getSVal(FieldVal);
-
-    if (isPrimitiveUninit(V)) {
-      if (addFieldToUninits({LocalChain, FR}))
-        ContainsUninitField = true;
+      if (isPrimitiveUninit(V)) {
+        if (addFieldToUninits({LocalChain, FR}))
+          ContainsUninitField = true;
+      }
+      continue;
     }
+
+    llvm_unreachable("All cases are handled!");
   }
 
   // Checking bases.




More information about the cfe-commits mailing list