about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDaniel Schemmel <daniel@schemmel.net>2023-06-28 15:13:50 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-07-08 22:53:34 +0200
commitc8acc60e25a120f9b2c8f0773068c2ce963d947e (patch)
treed87dab04609919ffa39d8f4449c9e5f7801cad62
parent1fb67ef82f2d1e79a2cdb9d12bf05b3514dd45a3 (diff)
downloadklee-c8acc60e25a120f9b2c8f0773068c2ce963d947e.tar.gz
Using std::memcpy prevents alignment problems and removes an unnecessary special case
-rw-r--r--lib/Expr/Expr.cpp6
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);
   }
 }