libhfuzz: add a flag to disable addr checks in HF_cmphash
__attribute__((visibility("hidden"))) __attribute__((used))
const char* const LIBHFUZZ_module_memorycmp = "LIBHFUZZ_module_memorycmp";
+/*
+ * util_getProgAddr() check is quite costly, and it lowers the fuzzing speed typically by a factor
+ * of 2, but keep it true for now
+ */
+#define HF_TEST_ADDR_CMPHASH true
+
static inline uintptr_t HF_cmphash(uintptr_t addr, const void* s1, const void* s2) {
- if (util_getProgAddr(s1) == LHFC_ADDR_RO) {
+ if (HF_TEST_ADDR_CMPHASH && util_getProgAddr(s1) == LHFC_ADDR_RO) {
addr ^= ((uintptr_t)s1 << 2);
}
- if (util_getProgAddr(s2) == LHFC_ADDR_RO) {
+ if (HF_TEST_ADDR_CMPHASH && util_getProgAddr(s2) == LHFC_ADDR_RO) {
addr ^= ((uintptr_t)s2 << 4);
}
return addr;
