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

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 15:17:36 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe10e120cea41: [BOLT][Runtime] Fix memset definition (authored by yota9).

Changed prior to commit:
  https://reviews.llvm.org/D129321?vs=443032&id=443369#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129321/new/

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) {
-  for (int I = 0; I < Size; ++I)
-    *Buf++ = C;
+void *memset(void *Buf, int C, size_t Size) {
+  char *S = (char *)Buf;
+  for (size_t I = 0; I < Size; ++I)
+    *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.443369.patch
Type: text/x-patch
Size: 492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220708/c165c8e2/attachment.bin>


More information about the llvm-commits mailing list