aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 96776b46ff..74e1a07631 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1731,7 +1731,7 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){
continue;
}
- // Check for casts from AllocaRegion pointer to typed pointer.
+ // Check for casts from a pointer to a region to typed pointer.
if (isa<loc::MemRegionVal>(V)) {
assert(Loc::IsLocType(T));
assert(Loc::IsLocType(ExTy));
@@ -1740,14 +1740,8 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){
std::pair<const GRState*, SVal> Res =
getStoreManager().CastRegion(St, V, T, CastE);
- const GRState* NewSt = Res.first;
- SVal NewPtr = Res.second;
-
- // If no new region is created, fall through to the default case.
- if (NewSt != St) {
- MakeNode(Dst, CastE, N, BindExpr(NewSt, CastE, NewPtr));
- continue;
- }
+ MakeNode(Dst, CastE, N, BindExpr(Res.first, CastE, Res.second));
+ continue;
}
// All other cases.