@@ -66,17 +66,16 @@ void NORETURN reportInvalidFlag(const char *FlagType, const char *Value) {
6666
6767// The checksum of a chunk header is invalid. This could be caused by an
6868// {over,under}write of the header, a pointer that is not an actual chunk.
69- void NORETURN reportHeaderCorruption (void *Header, void *Ptr) {
69+ void NORETURN reportHeaderCorruption (void *Header, const void *Ptr) {
7070 ScopedErrorReport Report;
7171 Report.append (" corrupted chunk header at address %p" , Ptr);
7272 if (*static_cast <Chunk::PackedHeader *>(Header) == 0U ) {
7373 // Header all zero, which could indicate that this might be a pointer that
7474 // has been double freed but the memory has been released to the kernel.
7575 Report.append (" : chunk header is zero and might indicate memory corruption "
76- " or a double free\n " ,
77- Ptr);
76+ " or a double free\n " );
7877 } else {
79- Report.append (" : most likely due to memory corruption\n " , Ptr );
78+ Report.append (" : most likely due to memory corruption\n " );
8079 }
8180}
8281
@@ -131,21 +130,21 @@ static const char *stringifyAction(AllocatorAction Action) {
131130
132131// The chunk is not in a state congruent with the operation we want to perform.
133132// This is usually the case with a double-free, a realloc of a freed pointer.
134- void NORETURN reportInvalidChunkState (AllocatorAction Action, void *Ptr) {
133+ void NORETURN reportInvalidChunkState (AllocatorAction Action, const void *Ptr) {
135134 ScopedErrorReport Report;
136135 Report.append (" invalid chunk state when %s address %p\n " ,
137136 stringifyAction (Action), Ptr);
138137}
139138
140- void NORETURN reportMisalignedPointer (AllocatorAction Action, void *Ptr) {
139+ void NORETURN reportMisalignedPointer (AllocatorAction Action, const void *Ptr) {
141140 ScopedErrorReport Report;
142141 Report.append (" misaligned pointer when %s address %p\n " ,
143142 stringifyAction (Action), Ptr);
144143}
145144
146145// The deallocation function used is at odds with the one used to allocate the
147146// chunk (eg: new[]/delete or malloc/delete, and so on).
148- void NORETURN reportDeallocTypeMismatch (AllocatorAction Action, void *Ptr,
147+ void NORETURN reportDeallocTypeMismatch (AllocatorAction Action, const void *Ptr,
149148 u8 TypeA, u8 TypeB) {
150149 ScopedErrorReport Report;
151150 Report.append (" allocation type mismatch when %s address %p (%d vs %d)\n " ,
@@ -154,7 +153,7 @@ void NORETURN reportDeallocTypeMismatch(AllocatorAction Action, void *Ptr,
154153
155154// The size specified to the delete operator does not match the one that was
156155// passed to new when allocating the chunk.
157- void NORETURN reportDeleteSizeMismatch (void *Ptr, uptr Size,
156+ void NORETURN reportDeleteSizeMismatch (const void *Ptr, uptr Size,
158157 uptr ExpectedSize) {
159158 ScopedErrorReport Report;
160159 Report.append (
0 commit comments