diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-03-05 02:33:55 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-03-05 02:33:55 +0000 |
| commit | 6c29a91c0513fd587019d4547d82832b4bbfd304 (patch) | |
| tree | 279590bd2f49f87452a24647f4287e48df734d25 | |
| parent | 477f990ac538ba44cb4bcd9e4690dddf2ffba4d8 (diff) | |
| download | bcm5719-llvm-6c29a91c0513fd587019d4547d82832b4bbfd304.tar.gz bcm5719-llvm-6c29a91c0513fd587019d4547d82832b4bbfd304.zip | |
Fix regression in transparent translation of nonloc::ConcreteInto to loc::ConcreteInt.
llvm-svn: 66125
| -rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 3d577006f3e..415bc3f88a1 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -1778,13 +1778,7 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){ MakeNode(Dst, CastE, N, BindExpr(state, CastE, V)); continue; } - - // Just pass through function and block pointers. - if (T->isBlockPointerType() || T->isFunctionPointerType()) { - MakeNode(Dst, CastE, N, BindExpr(state, CastE, V)); - continue; - } - + // Check for casts from pointers to integers. if (T->isIntegerType() && Loc::IsLocType(ExTy)) { VisitCastPointerToInteger(V, state, ExTy, CastE, N, Dst); @@ -1792,14 +1786,27 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){ } // Check for casts from integers to pointers. - if (Loc::IsLocType(T) && ExTy->isIntegerType()) + if (Loc::IsLocType(T) && ExTy->isIntegerType()) { if (nonloc::LocAsInteger *LV = dyn_cast<nonloc::LocAsInteger>(&V)) { // Just unpackage the lval and return it. V = LV->getLoc(); MakeNode(Dst, CastE, N, BindExpr(state, CastE, V)); - continue; } - + else if (nonloc::ConcreteInt *CI = dyn_cast<nonloc::ConcreteInt>(&V)) { + MakeNode(Dst, CastE, N, + BindExpr(state, CastE, loc::ConcreteInt(CI->getValue()))); + } + + continue; + } + + // Just pass through function and block pointers. + if (ExTy->isBlockPointerType() || ExTy->isFunctionPointerType()) { + assert(Loc::IsLocType(T)); + MakeNode(Dst, CastE, N, BindExpr(state, CastE, V)); + continue; + } + // Check for casts from array type to another type. if (ExTy->isArrayType()) { // We will always decay to a pointer. |

