From e10e120cea4196e580e7a04a1d2618d0de48cdeb Mon Sep 17 00:00:00 2001 From: Vladislav Khmelevsky Date: Thu, 7 Jul 2022 14:48:47 +0300 Subject: [PATCH] [BOLT][Runtime] Fix memset definition Differential Revision: https://reviews.llvm.org/D129321 --- bolt/runtime/common.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bolt/runtime/common.h b/bolt/runtime/common.h index 3920b1479e2e..008dbb6c3de8 100644 --- a/bolt/runtime/common.h +++ b/bolt/runtime/common.h @@ -103,9 +103,11 @@ void *memmove(void *Dest, const void *Src, size_t Len) { 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) {