diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-09-19 20:51:22 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-09-19 20:51:22 +0000 |
| commit | 31a15f8ba25ceb01e42437640a55739d20d48f37 (patch) | |
| tree | 7bc0641c8e872967d325e795257cff9f8dadc5d9 /clang/lib/Analysis/GRExprEngine.cpp | |
| parent | 37202acdff28fd3783b69996ca20c5ba6cd78772 (diff) | |
| download | bcm5719-llvm-31a15f8ba25ceb01e42437640a55739d20d48f37.tar.gz bcm5719-llvm-31a15f8ba25ceb01e42437640a55739d20d48f37.zip | |
Bug fix: for the base transfer function logic for casts, handle const casts as just propagating the value.
llvm-svn: 56368
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
| -rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 35facb35aef..423c4850d8e 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/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)) { |

