about summary refs log tree commit diff homepage
path: root/include
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2017-06-08 13:25:56 +0200
committerMartinNowack <martin.nowack@gmail.com>2018-09-18 10:36:36 +0100
commit06cf93da0c60a9a8f48c94db7fa1d8b2cc755eef (patch)
treea5f2aae289977e977f127d8598046b1546e0419d /include
parentb2659ec04a9814718736ad960635a9a28edd6078 (diff)
downloadklee-06cf93da0c60a9a8f48c94db7fa1d8b2cc755eef.tar.gz
llvm4: PointerType is not SequentialType
So handle the type specially whenever needed.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
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;
       }