forked from OSchip/llvm-project
Don't conjure a symbol for DeclStmts when the variable is a C++ reference.
llvm-svn: 97590
This commit is contained in:
parent
70e040d552
commit
c3c1b10243
|
@ -2358,8 +2358,9 @@ void GRExprEngine::VisitDeclStmt(DeclStmt *DS, ExplodedNode *Pred,
|
|||
|
||||
// Recover some path-sensitivity if a scalar value evaluated to
|
||||
// UnknownVal.
|
||||
if (InitVal.isUnknown() ||
|
||||
!getConstraintManager().canReasonAbout(InitVal)) {
|
||||
if ((InitVal.isUnknown() ||
|
||||
!getConstraintManager().canReasonAbout(InitVal)) &&
|
||||
!VD->getType()->isReferenceType()) {
|
||||
InitVal = ValMgr.getConjuredSymbolVal(NULL, InitEx,
|
||||
Builder->getCurrentBlockCount());
|
||||
}
|
||||
|
@ -2901,9 +2902,8 @@ void GRExprEngine::VisitReturnStmt(ReturnStmt *RS, ExplodedNode *Pred,
|
|||
if (Expr *RetE = RS->getRetValue()) {
|
||||
// Record the returned expression in the state.
|
||||
{
|
||||
static int Tag;
|
||||
SaveAndRestore<const void *> OldTag(Builder->Tag);
|
||||
Builder->Tag = &Tag;
|
||||
static int Tag = 0;
|
||||
SaveAndRestore<const void *> OldTag(Builder->Tag, &Tag);
|
||||
const GRState *state = GetState(Pred);
|
||||
state = state->set<ReturnExpr>(RetE);
|
||||
Pred = Builder->generateNode(RetE, state, Pred);
|
||||
|
|
Loading…
Reference in New Issue