about summary refs log tree commit diff homepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/klee/util/GetElementPtrTypeIterator.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/klee/util/GetElementPtrTypeIterator.h b/include/klee/util/GetElementPtrTypeIterator.h
index 5fb9f4ec..ce380bc0 100644
--- a/include/klee/util/GetElementPtrTypeIterator.h
+++ b/include/klee/util/GetElementPtrTypeIterator.h
@@ -78,6 +78,10 @@ class generic_gep_type_iterator
     generic_gep_type_iterator& operator++() {   // Preincrement
       if (llvm::CompositeType *CT = dyn_cast<llvm::CompositeType>(CurTy)) {
         CurTy = CT->getTypeAtIndex(getOperand());
+#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
+      } else if (auto ptr = dyn_cast<llvm::PointerType>(CurTy)) {
+        CurTy = ptr->getElementType();
+#endif
       } else {
         CurTy = 0;
       }