diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index c53d1f5aaea..3f2656240e4 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -1935,6 +1935,9 @@ SCEVHandle ScalarEvolution::createNodeForGEP(User *GEP) {    const Type *IntPtrTy = TD->getIntPtrType();    Value *Base = GEP->getOperand(0); +  // Don't attempt to analyze GEPs over unsized objects. +  if (!cast<PointerType>(Base->getType())->getElementType()->isSized()) +    return getUnknown(GEP);    SCEVHandle TotalOffset = getIntegerSCEV(0, IntPtrTy);    gep_type_iterator GTI = gep_type_begin(GEP);    for (GetElementPtrInst::op_iterator I = next(GEP->op_begin()), | 

