1 From c81a322476a1b1c57ca72832e10c43663557e097 Mon Sep 17 00:00:00 2001
2 From: Jie Fu <jiefu@tencent.com>
3 Date: Tue, 4 Apr 2023 07:40:34 +0800
4 Subject: [PATCH] [compiler-rt] Fix -Wcast-qual after D147005 (NFC)
6 /home/jiefu/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp:161:18: error: cast from 'const void *' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
11 compiler-rt/lib/dfsan/dfsan_allocator.cpp | 2 +-
12 compiler-rt/lib/lsan/lsan_allocator.cpp | 2 +-
13 compiler-rt/lib/msan/msan_allocator.cpp | 2 +-
14 compiler-rt/lib/tsan/rtl/tsan_mman.cpp | 2 +-
15 4 files changed, 4 insertions(+), 4 deletions(-)
17 diff --git a/compiler-rt/lib/dfsan/dfsan_allocator.cpp b/compiler-rt/lib/dfsan/dfsan_allocator.cpp
18 index cebf9983c9490..7ae6024fb2c9d 100644
19 --- a/compiler-rt/lib/dfsan/dfsan_allocator.cpp
20 +++ b/compiler-rt/lib/dfsan/dfsan_allocator.cpp
21 @@ -177,7 +177,7 @@ void *DFsanCalloc(uptr nmemb, uptr size) {
22 void *AllocationBegin(const void *p) {
25 - const void *beg = allocator.GetBlockBegin(p);
26 + void *beg = allocator.GetBlockBegin(p);
29 Metadata *b = (Metadata *)allocator.GetMetaData(beg);
30 diff --git a/compiler-rt/lib/lsan/lsan_allocator.cpp b/compiler-rt/lib/lsan/lsan_allocator.cpp
31 index d50882657dc33..b0a54d7cd9bc5 100644
32 --- a/compiler-rt/lib/lsan/lsan_allocator.cpp
33 +++ b/compiler-rt/lib/lsan/lsan_allocator.cpp
34 @@ -148,7 +148,7 @@ void GetAllocatorCacheRange(uptr *begin, uptr *end) {
35 void *GetMallocBegin(const void *p) {
38 - const void *beg = allocator.GetBlockBegin(p);
39 + void *beg = allocator.GetBlockBegin(p);
42 ChunkMetadata *m = Metadata(beg);
43 diff --git a/compiler-rt/lib/msan/msan_allocator.cpp b/compiler-rt/lib/msan/msan_allocator.cpp
44 index a760a434158a5..08ec3314b26e6 100644
45 --- a/compiler-rt/lib/msan/msan_allocator.cpp
46 +++ b/compiler-rt/lib/msan/msan_allocator.cpp
47 @@ -263,7 +263,7 @@ static void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size) {
48 void *AllocationBegin(const void *p) {
51 - const void *beg = allocator.GetBlockBegin(p);
52 + void *beg = allocator.GetBlockBegin(p);
55 Metadata *b = (Metadata *)allocator.GetMetaData(beg);
56 diff --git a/compiler-rt/lib/tsan/rtl/tsan_mman.cpp b/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
57 index 9c548dfff91f3..3cc4d16955ede 100644
58 --- a/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
59 +++ b/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
60 @@ -355,7 +355,7 @@ void *user_pvalloc(ThreadState *thr, uptr pc, uptr sz) {
61 void *user_alloc_begin(const void *p) {
62 if (p == nullptr || !IsAppMem((uptr)p))
64 - const void *beg = allocator()->GetBlockBegin(p);
65 + void *beg = allocator()->GetBlockBegin(p);