This replaces the hack in r291754, which was fixing pr31592, which was
caused by r291754, with a more appropriate solution.
rdar://problem/
28832541
Differential revision: https://reviews.llvm.org/D28602
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291781
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!TVR->getValueType()->isReferenceType())
return;
- // FIXME: This is a hotfix for https://llvm.org/bugs/show_bug.cgi?id=31592
- // A proper fix is very much necessary. Otherwise we would never normally bind
- // a NonLoc to a reference.
- if (V.getAs<NonLoc>())
- return;
-
ProgramStateRef State = C.getState();
ProgramStateRef StNonNull, StNull;
Init = ASE->getBase()->IgnoreImplicit();
SVal LValue = State->getSVal(Init, stackFrame);
- if (Optional<Loc> LValueLoc = LValue.getAs<Loc>())
- InitVal = State->getSVal(*LValueLoc);
+ if (!Field->getType()->isReferenceType())
+ if (Optional<Loc> LValueLoc = LValue.getAs<Loc>())
+ InitVal = State->getSVal(*LValueLoc);
// If we fail to get the value for some reason, use a symbolic value.
if (InitVal.isUnknownOrUndef()) {