diff options
author | Martin Nowack <martin_nowack@tu-dresden.de> | 2017-11-02 10:21:11 +0100 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2018-02-18 12:49:41 +0000 |
commit | 8383197858ed244c24577b23952e21f8d22f97ef (patch) | |
tree | f63a88930d5793e8e20b1ad070451c2b82ea4a19 /lib | |
parent | a0163772ee748796160ac8c2ae3b1376fef2bcf2 (diff) | |
download | klee-8383197858ed244c24577b23952e21f8d22f97ef.tar.gz |
Fail for aggegrations with big endian ordering
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Core/Executor.cpp | 1 | ||||
-rw-r--r-- | lib/Core/ExecutorUtil.cpp | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 2afa6958..1ab82595 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -2403,6 +2403,7 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { of == iIdx ? newElt : ExtractExpr::create(vec, bitOffset, EltBits)); } + assert(Context::get().isLittleEndian() && "FIXME:Broken for big endian"); ref<Expr> Result = ConcatExpr::createN(elementCount, elems.data()); bindLocal(ki, state, Result); break; diff --git a/lib/Core/ExecutorUtil.cpp b/lib/Core/ExecutorUtil.cpp index 61d6cf18..62d65c31 100644 --- a/lib/Core/ExecutorUtil.cpp +++ b/lib/Core/ExecutorUtil.cpp @@ -69,6 +69,8 @@ namespace klee { ref<Expr> kid = evalConstant(cds->getElementAsConstant(i - 1), ki); kids.push_back(kid); } + assert(Context::get().isLittleEndian() && + "FIXME:Broken for big endian"); ref<Expr> res = ConcatExpr::createN(kids.size(), kids.data()); return cast<ConstantExpr>(res); } else if (const ConstantStruct *cs = dyn_cast<ConstantStruct>(c)) { @@ -89,6 +91,8 @@ namespace klee { kids.push_back(kid); } + assert(Context::get().isLittleEndian() && + "FIXME:Broken for big endian"); ref<Expr> res = ConcatExpr::createN(kids.size(), kids.data()); return cast<ConstantExpr>(res); } else if (const ConstantArray *ca = dyn_cast<ConstantArray>(c)){ @@ -98,6 +102,8 @@ namespace klee { ref<Expr> kid = evalConstant(ca->getOperand(op), ki); kids.push_back(kid); } + assert(Context::get().isLittleEndian() && + "FIXME:Broken for big endian"); ref<Expr> res = ConcatExpr::createN(kids.size(), kids.data()); return cast<ConstantExpr>(res); } else if (const ConstantVector *cv = dyn_cast<ConstantVector>(c)) { @@ -107,6 +113,8 @@ namespace klee { for (unsigned i = numOperands; i != 0; --i) { kids.push_back(evalConstant(cv->getOperand(i - 1), ki)); } + assert(Context::get().isLittleEndian() && + "FIXME:Broken for big endian"); ref<Expr> res = ConcatExpr::createN(numOperands, kids.data()); assert(isa<ConstantExpr>(res) && "result of constant vector built is not a constant"); |