aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/Core
diff options
context:
space:
mode:
authorLukas Wölfer <lukas.woelfer@rwth-aachen.de>2018-06-02 19:45:58 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-11-05 20:14:07 +0000
commit548e51daca5d53127b1ba5988048a23b8cd6c17b (patch)
tree39ffbe7b3eb752fcce2717c5f220240ccd633c8f /lib/Core
parentea2b756666fa60b47efe16510d81c3b29beab4df (diff)
downloadklee-548e51daca5d53127b1ba5988048a23b8cd6c17b.tar.gz
Fixed crash on zero size arrays
Diffstat (limited to 'lib/Core')
-rw-r--r--lib/Core/ExecutorUtil.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Core/ExecutorUtil.cpp b/lib/Core/ExecutorUtil.cpp
index daea189a..c80354e2 100644
--- a/lib/Core/ExecutorUtil.cpp
+++ b/lib/Core/ExecutorUtil.cpp
@@ -59,6 +59,12 @@ namespace klee {
} else if (isa<ConstantPointerNull>(c)) {
return Expr::createPointer(0);
} else if (isa<UndefValue>(c) || isa<ConstantAggregateZero>(c)) {
+ if (getWidthForLLVMType(c->getType()) == 0) {
+ if (isa<llvm::LandingPadInst>(ki->inst)) {
+ klee_warning_once(0, "Using zero size array fix for landingpad instruction filter");
+ return ConstantExpr::create(0, 1);
+ }
+ }
return ConstantExpr::create(0, getWidthForLLVMType(c->getType()));
} else if (const ConstantDataSequential *cds =
dyn_cast<ConstantDataSequential>(c)) {