Skip to content

Commit 2a612a1

Browse files
[Memprof] Changes HISTOGRAM_GRANULARITY from 8U to 8ULL. (llvm#100949)
This changes a bug in memprofiling with histogram where the shadow mask would be `0xFFFFFFF8` instead of `0xFFFFFFFFFFFFFFF8`, essentially discarding the upper 32 bits of the address. This can cause different addresses to be mapped to the same shadow address.
1 parent 7b99b1d commit 2a612a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/memprof/memprof_mapping.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern uptr kHighMemEnd; // Initialized in __memprof_init.
5555
// computed by summing up all individual 1 byte counters. This can incur an
5656
// accuracy penalty.
5757

58-
#define HISTOGRAM_GRANULARITY 8U
58+
#define HISTOGRAM_GRANULARITY 8ULL
5959

6060
#define HISTOGRAM_MAX_COUNTER 255U
6161

0 commit comments

Comments
 (0)