]> granicus.if.org Git - clang/commitdiff
[analyzer] Silence an (incorrect) uninitialized variable warning, caught by Cameron.
authorJordy Rose <jediknil@belkadan.com>
Wed, 24 Aug 2011 20:38:42 +0000 (20:38 +0000)
committerJordy Rose <jediknil@belkadan.com>
Wed, 24 Aug 2011 20:38:42 +0000 (20:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138477 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/CFRefCount.cpp

index 25ec74ee444a8eda61eddc2a3de8c319d9ea2bdf..9f48b6c6bbe52378ca67b04e0775f43e610b5148 100644 (file)
@@ -1923,7 +1923,7 @@ namespace {
 } // end anonymous namespace
 
 void CFRefReport::addGCModeDescription(const CFRefCount &TF) {
-  const char *GCModeDescription;
+  const char *GCModeDescription = 0;
 
   switch (TF.getLangOptions().getGCMode()) {
   case LangOptions::GCOnly:
@@ -1950,6 +1950,7 @@ void CFRefReport::addGCModeDescription(const CFRefCount &TF) {
     }
   }
 
+  assert(GCModeDescription && "invalid/unknown GC mode");
   addExtraText(GCModeDescription);
 }