diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 1 | ||||
-rw-r--r-- | clang/test/Analysis/misc-ps-region-store.cpp | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 6e77b6b1038..c26867bf540 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -2125,6 +2125,7 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, ExplodedNode* Pred, if (asLValue) { ASTContext &Ctx = getContext(); T = Ctx.getPointerType(Ctx.getCanonicalType(T)); + ExTy = Ctx.getPointerType(Ctx.getCanonicalType(ExTy)); } for (ExplodedNodeSet::iterator I = S2.begin(), E = S2.end(); I != E; ++I) { diff --git a/clang/test/Analysis/misc-ps-region-store.cpp b/clang/test/Analysis/misc-ps-region-store.cpp index e1750139c2f..be150c92cc3 100644 --- a/clang/test/Analysis/misc-ps-region-store.cpp +++ b/clang/test/Analysis/misc-ps-region-store.cpp @@ -23,3 +23,14 @@ int test2_b_aux(const short &n); int test2_b(int n) { return test2_b_aux(n); } + +// Test getting the lvalue of a derived and converting it to a base. This +// previously crashed. +class Test3_Base {}; +class Test3_Derived : public Test3_Base {}; + +int test3_aux(Test3_Base &x); +int test3(Test3_Derived x) { + return test3_aux(x); +} + |