[analyzer] Made a buildbot happy.
authorKristof Umann <dkszelethus@gmail.com>
Tue, 19 Jun 2018 08:35:02 +0000 (08:35 +0000)
committerKristof Umann <dkszelethus@gmail.com>
Tue, 19 Jun 2018 08:35:02 +0000 (08:35 +0000)
Since `isPrimitiveType` was only used in an assert, a builbot with `-Werror`
and no asserts enabled failed to build it as it was unused.

llvm-svn: 335030

clang/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp

index 63e4b81..a517e81 100644 (file)
@@ -384,15 +384,17 @@ bool FindUninitializedFields::isNonUnionUninit(const TypedValueRegion *R,
       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.