mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 03:48:08 +00:00
move is_valid_addr in afl-qemu-common.h
This commit is contained in:
@ -81,3 +81,21 @@ void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc,
|
|||||||
|
|
||||||
void tcg_gen_afl_maybe_log_call(target_ulong cur_loc);
|
void tcg_gen_afl_maybe_log_call(target_ulong cur_loc);
|
||||||
|
|
||||||
|
|
||||||
|
/* Check if an address is valid in the current mapping */
|
||||||
|
|
||||||
|
static inline int is_valid_addr(target_ulong addr) {
|
||||||
|
|
||||||
|
int l, flags;
|
||||||
|
target_ulong page;
|
||||||
|
void * p;
|
||||||
|
|
||||||
|
page = addr & TARGET_PAGE_MASK;
|
||||||
|
l = (page + TARGET_PAGE_SIZE) - addr;
|
||||||
|
|
||||||
|
flags = page_get_flags(page);
|
||||||
|
if (!(flags & PAGE_VALID) || !(flags & PAGE_READ)) return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -451,24 +451,6 @@ static void afl_request_tsl(target_ulong pc, target_ulong cb, uint32_t flags,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if an address is valid in the current mapping */
|
|
||||||
|
|
||||||
static inline int is_valid_addr(target_ulong addr) {
|
|
||||||
|
|
||||||
int l, flags;
|
|
||||||
target_ulong page;
|
|
||||||
void * p;
|
|
||||||
|
|
||||||
page = addr & TARGET_PAGE_MASK;
|
|
||||||
l = (page + TARGET_PAGE_SIZE) - addr;
|
|
||||||
|
|
||||||
flags = page_get_flags(page);
|
|
||||||
if (!(flags & PAGE_VALID) || !(flags & PAGE_READ)) return 0;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is the other side of the same channel. Since timeouts are handled by
|
/* This is the other side of the same channel. Since timeouts are handled by
|
||||||
afl-fuzz simply killing the child, we can just wait until the pipe breaks. */
|
afl-fuzz simply killing the child, we can just wait until the pipe breaks. */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user