Skip to content

Commit

Permalink
[RISCV][sanitizer] Set SANITIZER_MMAP_RANGE_SIZE for sv57
Browse files Browse the repository at this point in the history
This patch enables sanitizers for sv57 virtual memory mode.
Alloctor checks whether SANITIZER_MMAP_RANGE_SIZE matches possible mmap
regions:
sanitizer_allocator_primary32.h:292 "((res)) <((kNumPossibleRegions))"

Since SANITIZER_MMAP_RANGE_SIZE only controls "possible" mmap regions,
setting it to (1 << 57) also works for sv39 and sv48.
  • Loading branch information
hau-hsu committed Jun 4, 2024
1 parent b011f12 commit 299ea60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
# if SANITIZER_FUCHSIA
# define SANITIZER_MMAP_RANGE_SIZE (1ULL << 38)
# else
# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47)
# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 56)
# endif
#elif defined(__aarch64__)
# if SANITIZER_APPLE
Expand Down

0 comments on commit 299ea60

Please sign in to comment.