forked from OSchip/llvm-project
Correctly enable test/Sema/unit-variables.c,
thus identifying a minor logical flaw in UninitializedValuesV2.cpp. llvm-svn: 123734
This commit is contained in:
parent
cab479f0ee
commit
c8d55da05a
|
@ -242,11 +242,13 @@ void TransferFunctions::VisitDeclStmt(DeclStmt *ds) {
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue