-Wuninitialized bugfix: when entering the scope of a variable with no
initializer, it is uninitialized, even if we may be coming from somewhere where
it was initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158611 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp
index 57dfab3..fbfa46c 100644
--- a/lib/Analysis/UninitializedValues.cpp
+++ b/lib/Analysis/UninitializedValues.cpp
@@ -625,6 +625,18 @@
           // the use of the uninitialized value (which visiting the
           // initializer).
           vals[vd] = Initialized;
+        } else {
+          // No initializer: the variable is now uninitialized. This matters
+          // for cases like:
+          //   while (...) {
+          //     int n;
+          //     use(n);
+          //     n = 0;
+          //   }
+          // FIXME: Mark the variable as uninitialized whenever its scope is
+          // left, since its scope could be re-entered by a jump over the
+          // declaration.
+          vals[vd] = Uninitialized;
         }
       }
     }