libhfuzz: cmp switch positioning
@@ -148,7 +148,9 @@ void __sanitizer_cov_trace_switch(uint64_t Val, uint64_t * Cases)
uint64_t mask = (1ULL << Cases[1]) - 1;
for (uint64_t i = 0; i < Cases[0]; i++) {
- uintptr_t pos = (((uintptr_t) __builtin_return_address(0) + i) << 8) % _HF_PERF_BITMAP_SIZE_16M;
+ uintptr_t pos =
+ (((uintptr_t) __builtin_return_address(0) + i) +
+ (_HF_PERF_BITMAP_SIZE_16M / 2)) % _HF_PERF_BITMAP_SIZE_16M;
uint8_t v = (uint8_t) Cases[1] - __builtin_popcountll((Val & mask) ^ (Cases[i + 2] & mask));
uint8_t prev = ATOMIC_GET(feedback->bbMapCmp[pos]);
if (prev < v) {
