Skip to content

Commit

Permalink
Don't use constexpr with ASAN.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhubner committed Mar 2, 2024
1 parent 2e4a811 commit 51db246
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/db_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,12 @@ Options DBTestBase::GetOptions(
"NewWritableFile:O_DIRECT");
#endif
// kMustFreeHeapAllocations -> indicates ASAN build
#if defined(__SANITIZE_ADDRESS__)
if (kMustFreeHeapAllocations && !options_override.full_block_cache) {
#else
if constexpr (kMustFreeHeapAllocations &&
!options_override.full_block_cache) {
#endif
// Detecting block cache use-after-free is normally difficult in unit
// tests, because as a cache, it tends to keep unreferenced entries in
// memory, and we normally want unit tests to take advantage of block
Expand Down

0 comments on commit 51db246

Please sign in to comment.