Fix ConstantExpr::getInsertElement.
authorGordon Henriksen <gordonhenriksen@mac.com>
Sat, 30 Aug 2008 15:41:51 +0000 (15:41 +0000)
committerGordon Henriksen <gordonhenriksen@mac.com>
Sat, 30 Aug 2008 15:41:51 +0000 (15:41 +0000)
Breakage was exposed in the Ocaml bindings tests after Chris
uncommented an assertion in r55084.

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

lib/VMCore/Constants.cpp

index c253e81588302761b8ae1364677e8127e91e89fa..4471cfde34d65995dd8f33d1544ea236b78159db 100644 (file)
@@ -2316,8 +2316,7 @@ Constant *ConstantExpr::getInsertElement(Constant *Val, Constant *Elt,
          && "Insertelement types must match!");
   assert(Idx->getType() == Type::Int32Ty &&
          "Insertelement index must be i32 type!");
          && "Insertelement types must match!");
   assert(Idx->getType() == Type::Int32Ty &&
          "Insertelement index must be i32 type!");
-  return getInsertElementTy(cast<VectorType>(Val->getType())->getElementType(),
-                            Val, Elt, Idx);
+  return getInsertElementTy(Val->getType(), Val, Elt, Idx);
 }
 
 Constant *ConstantExpr::getShuffleVectorTy(const Type *ReqTy, Constant *V1,
 }
 
 Constant *ConstantExpr::getShuffleVectorTy(const Type *ReqTy, Constant *V1,