From 255e16af36bc256ec8a9d50245a9943351019487 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Fri, 4 Nov 2011 12:25:02 +0000 Subject: Patch by Tom Bergan that fixes multi-byte reads on big-endian architectures. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@143693 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Core/Memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Core') diff --git a/lib/Core/Memory.cpp b/lib/Core/Memory.cpp index 08c0696c..c4228823 100644 --- a/lib/Core/Memory.cpp +++ b/lib/Core/Memory.cpp @@ -450,7 +450,7 @@ ref ObjectState::read(ref offset, Expr::Width width) const { ref Byte = read8(AddExpr::create(offset, ConstantExpr::create(idx, Expr::Int32))); - Res = idx ? ConcatExpr::create(Byte, Res) : Byte; + Res = i ? ConcatExpr::create(Byte, Res) : Byte; } return Res; @@ -468,7 +468,7 @@ ref ObjectState::read(unsigned offset, Expr::Width width) const { for (unsigned i = 0; i != NumBytes; ++i) { unsigned idx = Context::get().isLittleEndian() ? i : (NumBytes - i - 1); ref Byte = read8(offset + idx); - Res = idx ? ConcatExpr::create(Byte, Res) : Byte; + Res = i ? ConcatExpr::create(Byte, Res) : Byte; } return Res; -- cgit 1.4.1