[cfe-commits] r53649 - /cfe/trunk/lib/Analysis/GRSimpleVals.cpp
Ted Kremenek
kremenek at apple.com
Tue Jul 15 16:17:54 PDT 2008
Author: kremenek
Date: Tue Jul 15 18:17:54 2008
New Revision: 53649
URL: http://llvm.org/viewvc/llvm-project?rev=53649&view=rev
Log:
Fix transfer function logic in GRSimpleVals for integer casts: only support casts from integers to integers.
This fixes a crash reported by Anders Carlsson!
Modified:
cfe/trunk/lib/Analysis/GRSimpleVals.cpp
Modified: cfe/trunk/lib/Analysis/GRSimpleVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.cpp?rev=53649&r1=53648&r2=53649&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Tue Jul 15 18:17:54 2008
@@ -377,6 +377,10 @@
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();
More information about the cfe-commits
mailing list