]> granicus.if.org Git - clang/commitdiff
Thread safety: Initializing var before exhaustive switch statement to deal with extra...
authorCaitlin Sadowski <supertri@google.com>
Tue, 13 Sep 2011 18:01:58 +0000 (18:01 +0000)
committerCaitlin Sadowski <supertri@google.com>
Tue, 13 Sep 2011 18:01:58 +0000 (18:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139611 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/AnalysisBasedWarnings.cpp

index 81725c74f1a43d3b06d83b7c1df2f881299e52fd..8ea8a67bc7394b26ad40b9a2f350b550a3d2a5c5 100644 (file)
@@ -667,7 +667,7 @@ class ThreadSafetyReporter : public clang::thread_safety::ThreadSafetyHandler {
 
   void handleMutexNotHeld(const NamedDecl *D, ProtectedOperationKind POK,
                           Name LockName, LockKind LK, SourceLocation Loc) {
-    unsigned DiagID;
+    unsigned DiagID = 0;
     switch (POK) {
       case POK_VarAccess:
         DiagID = diag::warn_variable_requires_lock;