diff options
author | Martin Nowack <martin@se.inf.tu-dresden.de> | 2012-11-27 10:56:57 +0100 |
---|---|---|
committer | Martin Nowack <martin.nowack@gmail.com> | 2013-08-27 23:18:41 +0200 |
commit | 3f1b4ec3498585ee5eee48c1e031c8f073009ad7 (patch) | |
tree | 4687c0112f804db982c3796db039dc3da056fcba /lib/Core | |
parent | c4147c2ad9ba1e74642e1a3de31be8f4446cc7f3 (diff) | |
download | klee-3f1b4ec3498585ee5eee48c1e031c8f073009ad7.tar.gz |
Handle constant arrays as well
Diffstat (limited to 'lib/Core')
-rw-r--r-- | lib/Core/Executor.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 184b0983..88ede5c8 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -929,8 +929,17 @@ ref<klee::ConstantExpr> Executor::evalConstant(const Constant *c) { } ref<Expr> res = ConcatExpr::createN(kids.size(), kids.data()); return cast<ConstantExpr>(res); + } else if (const ConstantArray *ca = dyn_cast<ConstantArray>(c)){ + llvm::SmallVector<ref<Expr>, 4> kids; + for (unsigned i = ca->getNumOperands(); i != 0; --i) { + unsigned op = i-1; + ref<Expr> kid = evalConstant(ca->getOperand(op)); + kids.push_back(kid); + } + ref<Expr> res = ConcatExpr::createN(kids.size(), kids.data()); + return cast<ConstantExpr>(res); } else { - // Constant{Array,Vector} + // Constant{Vector} assert(0 && "invalid argument to evalConstant()"); } } |