Fix regression in transparent translation of nonloc::ConcreteInto to loc::ConcreteInt.
llvm-svn: 66125
This commit is contained in:
parent
477f990ac5
commit
6c29a91c05
|
@ -1779,12 +1779,6 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){
|
|||
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,11 +1786,24 @@ 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));
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue