diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-11-26 08:21:53 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-11-26 08:21:53 +0000 |
commit | 4fd56816e0925c04f2c92e75399f5c9018d5d6fb (patch) | |
tree | eb577fcd8de27fc7ae4f6bb183b07801aef22f07 /lib/Checker/GRExprEngine.cpp | |
parent | dc1ad2ce2acbf9d99061a40980c83715ad39f0f0 (diff) |
Regionstore: support derived-to-base cast by creating a CXXBaseObjectRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/GRExprEngine.cpp')
-rw-r--r-- | lib/Checker/GRExprEngine.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp index 4121144fad..f541a7ece4 100644 --- a/lib/Checker/GRExprEngine.cpp +++ b/lib/Checker/GRExprEngine.cpp @@ -2688,8 +2688,7 @@ void GRExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, case CK_IntegralComplexToFloatingComplex: case CK_AnyPointerToObjCPointerCast: case CK_AnyPointerToBlockPointerCast: - case CK_DerivedToBase: - case CK_UncheckedDerivedToBase: + case CK_ObjCObjectLValueCast: { // Delegate to SValuator to process. for (ExplodedNodeSet::iterator I = S2.begin(), E = S2.end(); I != E; ++I) { @@ -2702,7 +2701,20 @@ void GRExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, } return; } - + + case CK_DerivedToBase: + case CK_UncheckedDerivedToBase: + // For DerivedToBase cast, delegate to the store manager. + for (ExplodedNodeSet::iterator I = S2.begin(), E = S2.end(); I != E; ++I) { + ExplodedNode *node = *I; + const GRState *state = GetState(node); + SVal val = state->getSVal(Ex); + val = getStoreManager().evalDerivedToBase(val, T); + state = state->BindExpr(CastE, val); + MakeNode(Dst, CastE, node, state); + } + return; + // Various C++ casts that are not handled yet. case CK_Dynamic: case CK_ToUnion: |