diff options
author | Daniel Schemmel <daniel@schemmel.net> | 2023-06-28 15:13:50 +0000 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2023-07-08 22:53:34 +0200 |
commit | c8acc60e25a120f9b2c8f0773068c2ce963d947e (patch) | |
tree | d87dab04609919ffa39d8f4449c9e5f7801cad62 /lib/Expr | |
parent | 1fb67ef82f2d1e79a2cdb9d12bf05b3514dd45a3 (diff) | |
download | klee-c8acc60e25a120f9b2c8f0773068c2ce963d947e.tar.gz |
Using std::memcpy prevents alignment problems and removes an unnecessary special case
Diffstat (limited to 'lib/Expr')
-rw-r--r-- | lib/Expr/Expr.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index 2d3670d8..2026a07b 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -21,6 +21,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" +#include <cstring> #include <sstream> using namespace klee; @@ -369,14 +370,11 @@ void ConstantExpr::toMemory(void *address) { case Expr::Int16: *((uint16_t*) address) = getZExtValue(16); break; case Expr::Int32: *((uint32_t*) address) = getZExtValue(32); break; case Expr::Int64: *((uint64_t*) address) = getZExtValue(64); break; - // FIXME: what about machines without x87 support? case Expr::Fl80: - *((long double*) address) = *(const long double*) value.getRawData(); - break; case Expr::Int128: case Expr::Int256: case Expr::Int512: - memcpy(address, value.getRawData(), width / 8); + std::memcpy(address, value.getRawData(), width / 8); } } |