[cfe-commits] r123734 - in /cfe/trunk: lib/Analysis/UninitializedValuesV2.cpp test/Sema/uninit-variables.c
Ted Kremenek
kremenek at apple.com
Mon Jan 17 21:00:42 PST 2011
Author: kremenek
Date: Mon Jan 17 23:00:42 2011
New Revision: 123734
URL: http://llvm.org/viewvc/llvm-project?rev=123734&view=rev
Log:
Correctly enable test/Sema/unit-variables.c,
thus identifying a minor logical flaw in
UninitializedValuesV2.cpp.
Modified:
cfe/trunk/lib/Analysis/UninitializedValuesV2.cpp
cfe/trunk/test/Sema/uninit-variables.c
Modified: cfe/trunk/lib/Analysis/UninitializedValuesV2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/UninitializedValuesV2.cpp?rev=123734&r1=123733&r2=123734&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/UninitializedValuesV2.cpp (original)
+++ cfe/trunk/lib/Analysis/UninitializedValuesV2.cpp Mon Jan 17 23:00:42 2011
@@ -242,11 +242,13 @@
for (DeclStmt::decl_iterator DI = ds->decl_begin(), DE = ds->decl_end();
DI != DE; ++DI) {
if (VarDecl *vd = dyn_cast<VarDecl>(*DI)) {
- if (isTrackedVar(vd))
+ if (isTrackedVar(vd)) {
+ vals[vd] = Uninitialized;
if (Stmt *init = vd->getInit()) {
Visit(init);
vals[vd] = Initialized;
}
+ }
}
}
}
Modified: cfe/trunk/test/Sema/uninit-variables.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/uninit-variables.c?rev=123734&r1=123733&r2=123734&view=diff
==============================================================================
--- cfe/trunk/test/Sema/uninit-variables.c (original)
+++ cfe/trunk/test/Sema/uninit-variables.c Mon Jan 17 23:00:42 2011
@@ -1,4 +1,4 @@
-// RUN: %clang -Wuninitialized-experimental -fsyntax-only %s
+// RUN: %clang_cc1 -fsyntax-only -Wuninitialized-experimental -fsyntax-only %s -verify
int test1() {
int x;
More information about the cfe-commits
mailing list