forked from OSchip/llvm-project
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:
parent
7ebdd255b5
commit
fb475ec504
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue