added llvm_mode ngram coverage

This commit is contained in:
van Hauser
2020-03-20 17:10:44 +01:00
parent f21ff8bac8
commit 5a74cffa0f
10 changed files with 186 additions and 41 deletions

View File

@ -26,6 +26,7 @@
#include "config.h"
#include "types.h"
#include "cmplog.h"
#include "llvm-ngram-coverage.h"
#include <stdio.h>
#include <stdlib.h>
@ -62,11 +63,11 @@ u8 __afl_area_initial[MAP_SIZE];
u8 *__afl_area_ptr = __afl_area_initial;
#ifdef __ANDROID__
u32 __afl_prev_loc;
u32 __afl_final_loc;
PREV_LOC_T __afl_prev_loc[MAX_NGRAM_SIZE];
u32 __afl_final_loc;
#else
__thread u32 __afl_prev_loc;
__thread u32 __afl_final_loc;
__thread PREV_LOC_T __afl_prev_loc[MAX_NGRAM_SIZE];
__thread u32 __afl_final_loc;
#endif
struct cmp_map *__afl_cmp_map;
@ -281,7 +282,7 @@ int __afl_persistent_loop(unsigned int max_cnt) {
memset(__afl_area_ptr, 0, MAP_SIZE);
__afl_area_ptr[0] = 1;
__afl_prev_loc = 0;
memset(__afl_prev_loc, 0, MAX_NGRAM_SIZE * sizeof(PREV_LOC_T));
}
@ -298,7 +299,7 @@ int __afl_persistent_loop(unsigned int max_cnt) {
raise(SIGSTOP);
__afl_area_ptr[0] = 1;
__afl_prev_loc = 0;
memset(__afl_prev_loc, 0, MAX_NGRAM_SIZE * sizeof(PREV_LOC_T));
return 1;