[analyzer] Fix a crash until we can handle temporary struct objects properly.
llvm-svn: 124822
This commit is contained in:
parent
4e03719cce
commit
58f8b590e1
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -17,3 +17,13 @@ void f() {
|
|||
struct s a;
|
||||
int *p = &(a.n) + 1;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
int x,y;
|
||||
} Point;
|
||||
|
||||
Point getit(void);
|
||||
void test() {
|
||||
Point p;
|
||||
(void)(p = getit()).x;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue