aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-01 21:08:52 +0000
committerChris Lattner <sabre@nondot.org>2003-07-01 21:08:52 +0000
commit5fd60913da4e348b8d75ae3e7fced4a26ae4bb2f (patch)
treecb62a8755d95d866ef64ecd8912da10df9e2a5c9 /lib/Analysis
parent7b702b81ee20cdf8e4a72da567819a8282a8149b (diff)
downloadexternal_llvm-5fd60913da4e348b8d75ae3e7fced4a26ae4bb2f.zip
external_llvm-5fd60913da4e348b8d75ae3e7fced4a26ae4bb2f.tar.gz
external_llvm-5fd60913da4e348b8d75ae3e7fced4a26ae4bb2f.tar.bz2
Fix bug: Regression/Other/2002-03-11-ExprAssertion.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/Expressions.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Analysis/Expressions.cpp b/lib/Analysis/Expressions.cpp
index b9a1b01..9b305bb 100644
--- a/lib/Analysis/Expressions.cpp
+++ b/lib/Analysis/Expressions.cpp
@@ -317,7 +317,9 @@ ExprType ClassifyExpression(Value *Expr) {
if (isa<PointerType>(DestTy))
DestTy = Type::ULongTy; // Pointer types are represented as ulong
- if (!Src.getExprType(0)->isLosslesslyConvertibleTo(DestTy)) {
+ const Type *SrcValTy = Src.getExprType(0);
+ if (!SrcValTy) return I;
+ if (!SrcValTy->isLosslesslyConvertibleTo(DestTy)) {
if (Src.ExprTy != ExprType::Constant)
return I; // Converting cast, and not a constant value...
}