Changed merge operation for uninitialized values analysis to "intersect" (previous union).

The effect is that if a variable is uninitialized along a branch (but initialized along another), at merge points it is considered uninitialized.  Previously we had the opposite behavior.  The new behavior is more conservative, and more in line with gcc's behavior.

llvm-svn: 48689
This commit is contained in:
Ted Kremenek 2008-03-22 20:11:00 +00:00
parent 7ebdd255b5
commit fb475ec504
2 changed files with 2 additions and 2 deletions

View File

@ -223,7 +223,7 @@ bool TransferFuncs::BlockStmt_VisitExpr(Expr* E) {
//===----------------------------------------------------------------------===//
namespace {
typedef ExprDeclBitVector_Types::Union Merge;
typedef ExprDeclBitVector_Types::Intersect Merge;
typedef DataflowSolver<UninitializedValues,TransferFuncs,Merge> Solver;
}

View File

@ -20,7 +20,7 @@ int f3(int x) {
int f4(int x) {
int y;
if (x) y = 1;
return y; // no-warning
return y; // expected-warning {{use of uninitialized variable}}
}
int f5() {