aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-03 22:01:32 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-03 22:01:32 +0000
commitc2e20d0c42cf085940c9a9cb495a7116d1b0eb07 (patch)
tree92d6bdbe95aaf8017baca8aab64ca1efea7ae42b /lib/StaticAnalyzer/Checkers/ExprEngine.cpp
parentafdf137c50f7f96ef865cf007f660dd663a8731f (diff)
[analyzer] Fix a crash until we can handle temporary struct objects properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/ExprEngine.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/ExprEngine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
index 79d2a2b2fc..2dd2202f03 100644
--- a/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
+++ b/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
@@ -1716,7 +1716,11 @@ void ExprEngine::VisitMemberExpr(const MemberExpr* M, ExplodedNode* Pred,
const GRState* state = GetState(*I);
SVal baseExprVal = state->getSVal(baseExpr);
if (isa<nonloc::LazyCompoundVal>(baseExprVal) ||
- isa<nonloc::CompoundVal>(baseExprVal)) {
+ isa<nonloc::CompoundVal>(baseExprVal) ||
+ // FIXME: This can originate by conjuring a symbol for an unknown
+ // temporary struct object, see test/Analysis/fields.c:
+ // (p = getit()).x
+ isa<nonloc::SymbolVal>(baseExprVal)) {
MakeNode(Dst, M, *I, state->BindExpr(M, UnknownVal()));
continue;
}