]> granicus.if.org Git - clang/commitdiff
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335030 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp

index 63e4b817da33565bc69732d1891bcece38a1d903..a517e81122b1fb74a3baa55c082c8e7d7698786d 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.