aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-09-19 20:51:22 +0000
committerTed Kremenek <kremenek@apple.com>2008-09-19 20:51:22 +0000
commita8fe39fbecf549fed411f83f91ca2b666fc9e884 (patch)
tree7147f5e8f3640554a390efb057feb0d38e07d1c9 /lib/Analysis/GRExprEngine.cpp
parent9cbff26be37242451c26b1e8b76d52b8a3e8088a (diff)
Bug fix: for the base transfer function logic for casts, handle const casts as just propagating the value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 35facb35ae..423c4850d8 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1432,6 +1432,15 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){
MakeNode(Dst, CastE, N, SetRVal(St, CastE, V));
continue;
}
+
+ // For const casts, just propagate the value.
+ ASTContext& C = getContext();
+
+ if (C.getCanonicalType(T).getUnqualifiedType() ==
+ C.getCanonicalType(ExTy).getUnqualifiedType()) {
+ MakeNode(Dst, CastE, N, SetRVal(St, CastE, V));
+ continue;
+ }
// Check for casts from pointers to integers.
if (T->isIntegerType() && LVal::IsLValType(ExTy)) {