Fix bug: Regression/Other/2002-03-11-ExprAssertion.ll
authorChris Lattner <sabre@nondot.org>
Tue, 1 Jul 2003 21:08:52 +0000 (21:08 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 1 Jul 2003 21:08:52 +0000 (21:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7046 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/Expressions.cpp

index b9a1b01dbc9fbafc345073ea9b9321fd9969c390..9b305bbe4097ea32d1700e001ed4f691ff021480 100644 (file)
@@ -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...
     }