mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 11:58:08 +00:00
code format
This commit is contained in:
@ -1021,25 +1021,30 @@ void recalculate_all_scores(afl_state_t *afl) {
|
|||||||
u32 id = afl->queue_buf[i]->id;
|
u32 id = afl->queue_buf[i]->id;
|
||||||
|
|
||||||
if (!candidate_ids) {
|
if (!candidate_ids) {
|
||||||
|
|
||||||
// first candidate: [count][id]
|
// first candidate: [count][id]
|
||||||
candidate_ids = ck_alloc(sizeof(u32) * 2);
|
candidate_ids = ck_alloc(sizeof(u32) * 2);
|
||||||
candidate_ids[0] = 1; // count = 1
|
candidate_ids[0] = 1; // count = 1
|
||||||
candidate_ids[1] = id; // first ID
|
candidate_ids[1] = id; // first ID
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
u32 count = candidate_ids[0];
|
u32 count = candidate_ids[0];
|
||||||
|
|
||||||
candidate_ids = ck_realloc(candidate_ids, sizeof(u32) * (count + 2));
|
candidate_ids =
|
||||||
|
ck_realloc(candidate_ids, sizeof(u32) * (count + 2));
|
||||||
candidate_ids[0] = count + 1; // increment the count
|
candidate_ids[0] = count + 1; // increment the count
|
||||||
candidate_ids[count + 1] = id; // append the new ID to the end
|
candidate_ids[count + 1] = id; // append the new ID to the end
|
||||||
|
|
||||||
//fprintf(stderr, "enroll candidate[%u][%u] %u\n", i, j, id);
|
// fprintf(stderr, "enroll candidate[%u][%u] %u\n", i, j, id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
afl->top_rated_candidates[j] = candidate_ids;
|
afl->top_rated_candidates[j] = candidate_ids;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1050,13 +1055,16 @@ void recalculate_all_scores(afl_state_t *afl) {
|
|||||||
for (i = 0; i < afl->fsrv.map_size; ++i) {
|
for (i = 0; i < afl->fsrv.map_size; ++i) {
|
||||||
|
|
||||||
u32 *candidate_ids = afl->top_rated_candidates[i];
|
u32 *candidate_ids = afl->top_rated_candidates[i];
|
||||||
if(candidate_ids) {
|
if (candidate_ids) {
|
||||||
|
|
||||||
u32 count = candidate_ids[0];
|
u32 count = candidate_ids[0];
|
||||||
|
|
||||||
for(u32 k = 0; k < count; k++) {
|
for (u32 k = 0; k < count; k++) {
|
||||||
|
|
||||||
u32 id = candidate_ids[k + 1];
|
u32 id = candidate_ids[k + 1];
|
||||||
struct queue_entry *entry = afl->queue_buf[id];
|
struct queue_entry *entry = afl->queue_buf[id];
|
||||||
update_bitmap_rescore(afl, entry, i);
|
update_bitmap_rescore(afl, entry, i);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -744,7 +744,9 @@ void afl_state_deinit(afl_state_t *afl) {
|
|||||||
for (u32 i = 0; i < afl->fsrv.map_size; i++) {
|
for (u32 i = 0; i < afl->fsrv.map_size; i++) {
|
||||||
|
|
||||||
if (afl->top_rated_candidates[i]) {
|
if (afl->top_rated_candidates[i]) {
|
||||||
|
|
||||||
ck_free(afl->top_rated_candidates[i]);
|
ck_free(afl->top_rated_candidates[i]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user