mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 19:08:08 +00:00
cpp fix
This commit is contained in:
@ -1409,8 +1409,8 @@ void __afl_coverage_on() {
|
|||||||
// discard all coverage up to this point
|
// discard all coverage up to this point
|
||||||
void __afl_coverage_discard() {
|
void __afl_coverage_discard() {
|
||||||
|
|
||||||
memset(__afl_area_ptr, 0, __afl_map_size);
|
memset(__afl_area_ptr_backup, 0, __afl_map_size);
|
||||||
__afl_area_ptr[0] = 1;
|
__afl_area_ptr_backup[0] = 1;
|
||||||
|
|
||||||
if (__afl_cmp_map) { memset(__afl_cmp_map, 0, sizeof(struct cmp_map)); }
|
if (__afl_cmp_map) { memset(__afl_cmp_map, 0, sizeof(struct cmp_map)); }
|
||||||
|
|
||||||
|
25
src/afl-cc.c
25
src/afl-cc.c
@ -829,12 +829,25 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
"extern unsigned char *__afl_fuzz_ptr;"
|
"extern unsigned char *__afl_fuzz_ptr;"
|
||||||
"unsigned char __afl_fuzz_alt[1048576];"
|
"unsigned char __afl_fuzz_alt[1048576];"
|
||||||
"unsigned char *__afl_fuzz_alt_ptr = __afl_fuzz_alt;";
|
"unsigned char *__afl_fuzz_alt_ptr = __afl_fuzz_alt;";
|
||||||
cc_params[cc_par_cnt++] =
|
if (plusplus_mode) {
|
||||||
"-D__AFL_COVERAGE()=int __afl_selective_coverage = 1;"
|
|
||||||
"void __afl_coverage_discard();"
|
"-D__AFL_COVERAGE()=int __afl_selective_coverage = 1;"
|
||||||
"void __afl_coverage_abort();"
|
"extern \"C\" void __afl_coverage_discard();"
|
||||||
"void __afl_coverage_on();"
|
"extern \"C\" void __afl_coverage_abort();"
|
||||||
"void __afl_coverage_off();";
|
"extern \"C\" void __afl_coverage_on();"
|
||||||
|
"extern \"C\" void __afl_coverage_off();";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
cc_params[cc_par_cnt++] =
|
||||||
|
"-D__AFL_COVERAGE()=int __afl_selective_coverage = 1;"
|
||||||
|
"void __afl_coverage_discard();"
|
||||||
|
"void __afl_coverage_abort();"
|
||||||
|
"void __afl_coverage_on();"
|
||||||
|
"void __afl_coverage_off();";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
cc_params[cc_par_cnt++] =
|
cc_params[cc_par_cnt++] =
|
||||||
"-D__AFL_COVERAGE_START_OFF()=int __afl_selective_coverage_start_off = "
|
"-D__AFL_COVERAGE_START_OFF()=int __afl_selective_coverage_start_off = "
|
||||||
"1;";
|
"1;";
|
||||||
|
Reference in New Issue
Block a user