From f496ee1710bd5d78a8948dbfd44798e8b12437e8 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 15 Jul 2008 23:17:54 +0000 Subject: [PATCH] Fix transfer function logic in GRSimpleVals for integer casts: only support casts from integers to integers. 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp index 860a786089..562e5794b2 100644 --- a/lib/Analysis/GRSimpleVals.cpp +++ b/lib/Analysis/GRSimpleVals.cpp @@ -377,6 +377,10 @@ RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, NonLVal X, QualType T) { if (!isa(X)) return UnknownVal(); + // Only handle casts from integers to integers. + if (!T->isIntegerType()) + return UnknownVal(); + BasicValueFactory& BasicVals = Eng.getBasicVals(); llvm::APSInt V = cast(X).getValue(); -- 2.50.1