Change the analyzer to recognize (but ignore) assignments to isa. Fixes PR 6302.

llvm-svn: 99904
This commit is contained in:
Ted Kremenek 2010-03-30 18:24:54 +00:00
parent 5cab26d058
commit 4be6a75884
2 changed files with 15 additions and 0 deletions

View File

@ -897,6 +897,11 @@ void GRExprEngine::VisitLValue(Expr* Ex, ExplodedNode* Pred,
return;
}
case Stmt::ObjCIsaExprClass:
// FIXME: Do something more intelligent with 'x->isa = ...'.
// For now, just ignore the assignment.
return;
case Stmt::ObjCPropertyRefExprClass:
case Stmt::ObjCImplicitSetterGetterRefExprClass:
// FIXME: Property assignments are lvalues, but not really "locations".

View File

@ -910,3 +910,13 @@ int rdar_7770737_pos(void)
struct rdar_7770737_s f = { .p = (intptr_t)&x };
return x; // expected-warning{{Undefined or garbage value returned to caller}}
}
//===----------------------------------------------------------------------===//
// Test handling of the implicit 'isa' field. For now we don't do anything
// interesting.
//===----------------------------------------------------------------------===//
void pr6302(id x, Class y) {
// This previously crashed the analyzer (reported in PR 6302)
x->isa = y;
}