Fixed bug in live-variable analysis and uninitialized-values analysis where
we incorrectly examine the expression within a sizeof() for use in computing dataflow values. This fixes: PR 1858 (http://llvm.org/bugs/show_bug.cgi?id=1858) llvm-svn: 44982
This commit is contained in:
parent
37c36ed79a
commit
78dcda6059
|
@ -93,6 +93,7 @@ void TransferFuncs::VisitUnaryOperator(UnaryOperator* U) {
|
|||
Stmt *S = U->getSubExpr();
|
||||
|
||||
switch (U->getOpcode()) {
|
||||
case UnaryOperator::SizeOf: return;
|
||||
case UnaryOperator::PostInc:
|
||||
case UnaryOperator::PostDec:
|
||||
case UnaryOperator::PreInc:
|
||||
|
|
|
@ -136,9 +136,19 @@ bool TransferFuncs::VisitCallExpr(CallExpr* C) {
|
|||
}
|
||||
|
||||
bool TransferFuncs::VisitUnaryOperator(UnaryOperator* U) {
|
||||
if (U->getOpcode() == UnaryOperator::AddrOf)
|
||||
if (BlockVarDecl* VD = FindBlockVarDecl(U->getSubExpr()))
|
||||
return V(VD,AD) = Initialized;
|
||||
switch (U->getOpcode()) {
|
||||
case UnaryOperator::AddrOf:
|
||||
if (BlockVarDecl* VD = FindBlockVarDecl(U->getSubExpr()))
|
||||
return V(VD,AD) = Initialized;
|
||||
|
||||
break;
|
||||
|
||||
case UnaryOperator::SizeOf:
|
||||
return Initialized;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return Visit(U->getSubExpr());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue