From 548e51daca5d53127b1ba5988048a23b8cd6c17b Mon Sep 17 00:00:00 2001 From: Lukas Wölfer Date: Sat, 2 Jun 2018 19:45:58 +0200 Subject: Fixed crash on zero size arrays --- lib/Core/ExecutorUtil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Core/ExecutorUtil.cpp') 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(c)) { return Expr::createPointer(0); } else if (isa(c) || isa(c)) { + if (getWidthForLLVMType(c->getType()) == 0) { + if (isa(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(c)) { -- cgit 1.4.1