OBS-URL: https://build.opensuse.org/package/show/devel:tools:statica/klee?expand=0&rev=37
32 lines
1.3 KiB
Diff
32 lines
1.3 KiB
Diff
From: Martin Nowack <martin_nowack@tu-dresden.de>
|
|
Date: Sun, 29 Oct 2017 22:02:32 +0100
|
|
Subject: Fix generation of expressions from constant sequential data
|
|
Patch-mainline: no
|
|
|
|
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
|
---
|
|
lib/Core/ExecutorUtil.cpp | 6 ++++--
|
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/lib/Core/ExecutorUtil.cpp b/lib/Core/ExecutorUtil.cpp
|
|
index 53f4c5b85754..4f51ecb6301b 100644
|
|
--- a/lib/Core/ExecutorUtil.cpp
|
|
+++ b/lib/Core/ExecutorUtil.cpp
|
|
@@ -58,9 +58,11 @@ namespace klee {
|
|
return ConstantExpr::create(0, getWidthForLLVMType(c->getType()));
|
|
} else if (const ConstantDataSequential *cds =
|
|
dyn_cast<ConstantDataSequential>(c)) {
|
|
+ // Handle a vector or array: first element has the smallest address,
|
|
+ // the last element the highest
|
|
std::vector<ref<Expr> > kids;
|
|
- for (unsigned i = 0, e = cds->getNumElements(); i != e; ++i) {
|
|
- ref<Expr> kid = evalConstant(cds->getElementAsConstant(i), ki);
|
|
+ for (unsigned i = cds->getNumElements(); i != 0; --i) {
|
|
+ ref<Expr> kid = evalConstant(cds->getElementAsConstant(i - 1), ki);
|
|
kids.push_back(kid);
|
|
}
|
|
ref<Expr> res = ConcatExpr::createN(kids.size(), kids.data());
|
|
--
|
|
2.15.1
|
|
|