[PATCH] D129321: [BOLT][Runtime] Fix memset definition

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 12:46:38 PDT 2022


yota9 created this revision.
yota9 added reviewers: maksfb, rafauler, Amir.
Herald added a subscriber: ayermolo.
Herald added a project: All.
yota9 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129321

Files:
  bolt/runtime/common.h


Index: bolt/runtime/common.h
===================================================================
--- bolt/runtime/common.h
+++ bolt/runtime/common.h
@@ -103,9 +103,11 @@
   return Dest;
 }
 
-void memset(char *Buf, char C, uint32_t Size) {
+void *memset(void *Buf, int C, size_t Size) {
+  char *S = (char *)Buf;
   for (int I = 0; I < Size; ++I)
-    *Buf++ = C;
+    *S++ = C;
+  return Buf;
 }
 
 int memcmp(const void *s1, const void *s2, size_t n) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129321.443032.patch
Type: text/x-patch
Size: 455 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220707/988d0088/attachment.bin>


More information about the llvm-commits mailing list