]> granicus.if.org Git - clang/commitdiff
Fix transfer function logic in GRSimpleVals for integer casts: only support casts...
authorTed Kremenek <kremenek@apple.com>
Tue, 15 Jul 2008 23:17:54 +0000 (23:17 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 15 Jul 2008 23:17:54 +0000 (23:17 +0000)
This fixes a crash reported by Anders Carlsson!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53649 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRSimpleVals.cpp

index 860a78608967e99fd4b983e268b5ade1079ef7fe..562e5794b2fec9ee52033e21fc1b8c59da56c4e6 100644 (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();