diff options
author | Anna Zaks <ganna@apple.com> | 2012-08-03 21:43:37 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-08-03 21:43:37 +0000 |
commit | 148fee988e32efcad45ecf7b3bf714880c657dda (patch) | |
tree | 0d51ee02bdc3957c1338ce25a091324e8cc150c4 /lib/StaticAnalyzer/Core/ExprEngineC.cpp | |
parent | 89ab7d0012ffe02a335b765eeb9b48977a5ecd79 (diff) |
[analyzer] ObjC Inlining: Start tracking dynamic type info in the GDM
In the following code, find the type of the symbolic receiver by
following it and updating the dynamic type info in the state when we
cast the symbol from id to MyClass *.
MyClass *a = [[self alloc] init];
return 5/[a testSelf];
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngineC.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngineC.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/lib/StaticAnalyzer/Core/ExprEngineC.cpp index 7ec151ef6d..740dec5ec4 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -308,6 +308,9 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, const LocationContext *LCtx = Pred->getLocationContext(); SVal V = state->getSVal(Ex, LCtx); V = svalBuilder.evalCast(V, T, ExTy); + if (const MemRegion *R = V.getAsRegion()) { + state = state->addDynamicTypeInfo(R, T); + } state = state->BindExpr(CastE, LCtx, V); Bldr.generateNode(CastE, Pred, state); continue; |