From c8acc60e25a120f9b2c8f0773068c2ce963d947e Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Wed, 28 Jun 2023 15:13:50 +0000 Subject: Using std::memcpy prevents alignment problems and removes an unnecessary special case --- lib/Expr/Expr.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') 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 #include 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); } } -- cgit 1.4.1