Fix transfer function logic in GRSimpleVals for integer casts: only support casts from integers to integers.

This fixes a crash reported by Anders Carlsson!

llvm-svn: 53649
This commit is contained in:
Ted Kremenek 2008-07-15 23:17:54 +00:00
parent 3be3401303
commit f46dddac5b
1 changed files with 4 additions and 0 deletions

View File

@ -377,6 +377,10 @@ RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, NonLVal X, QualType T) {
if (!isa<nonlval::ConcreteInt>(X))
return UnknownVal();
// Only handle casts from integers to integers.
if (!T->isIntegerType())
return UnknownVal();
BasicValueFactory& BasicVals = Eng.getBasicVals();
llvm::APSInt V = cast<nonlval::ConcreteInt>(X).getValue();