From: Jordy Rose Date: Wed, 24 Aug 2011 20:38:42 +0000 (+0000) Subject: [analyzer] Silence an (incorrect) uninitialized variable warning, caught by Cameron. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f95b19de813017e6a4aa99d71dd40112197c3019;p=clang [analyzer] Silence an (incorrect) uninitialized variable warning, caught by Cameron. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138477 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/CFRefCount.cpp b/lib/StaticAnalyzer/Core/CFRefCount.cpp index 25ec74ee44..9f48b6c6bb 100644 --- a/lib/StaticAnalyzer/Core/CFRefCount.cpp +++ b/lib/StaticAnalyzer/Core/CFRefCount.cpp @@ -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); }