Add support for vectors of pointers.
[oota-llvm.git] / lib / Analysis / ConstantFolding.cpp
index d12476885e4036e159d164a33bc403f80b32f983..7e98b218884ea3b22241b8ceeeb09907223a6c0c 100644 (file)
@@ -580,7 +580,8 @@ static Constant *SymbolicallyEvaluateGEP(ArrayRef<Constant *> Ops,
                                          Type *ResultTy, const TargetData *TD,
                                          const TargetLibraryInfo *TLI) {
   Constant *Ptr = Ops[0];
-  if (!TD || !cast<PointerType>(Ptr->getType())->getElementType()->isSized())
+  if (!TD || !cast<PointerType>(Ptr->getType())->getElementType()->isSized() ||
+      !Ptr->getType()->isPointerTy())
     return 0;
   
   Type *IntPtrTy = TD->getIntPtrType(Ptr->getContext());