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 | ec0b8e32eec37c4713f865373a812749ede815a6 (patch) | |
| tree | fa071b1209d5a32a45041cb45d94433473535179 /clang/lib/Checker/GRExprEngine.cpp | |
| parent | e23ab6fae29ab8f301fb529d6b7e4dd40c45b4e5 (diff) | |
| download | bcm5719-llvm-ec0b8e32eec37c4713f865373a812749ede815a6.tar.gz bcm5719-llvm-ec0b8e32eec37c4713f865373a812749ede815a6.zip | |
Regionstore: support derived-to-base cast by creating a CXXBaseObjectRegion.
llvm-svn: 120173
Diffstat (limited to 'clang/lib/Checker/GRExprEngine.cpp')
| -rw-r--r-- | clang/lib/Checker/GRExprEngine.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/clang/lib/Checker/GRExprEngine.cpp b/clang/lib/Checker/GRExprEngine.cpp index 4121144fad2..f541a7ece4a 100644 --- a/clang/lib/Checker/GRExprEngine.cpp +++ b/clang/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: |

