diff options
author | Robert Swiecki <robert@swiecki.net> | 2018-03-02 03:05:26 +0100 |
---|---|---|
committer | Robert Swiecki <robert@swiecki.net> | 2018-03-02 03:05:26 +0100 |
commit | 04dcac30bf872c0d3523fb5dd74eb629cacaf490 (patch) | |
tree | 6926b8f3ed8403a9a5c8d06b1549bcf0a7011e44 /mangle.c | |
parent | fbe975598859985c8c800aaaf212e8e29632fad9 (diff) | |
download | honggfuzz-04dcac30bf872c0d3523fb5dd74eb629cacaf490.tar.gz |
honggfuzz.h: move some global struct values into substructs
Diffstat (limited to 'mangle.c')
-rw-r--r-- | mangle.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -109,13 +109,13 @@ static void mangle_Bit(run_t* run) { } static void mangle_DictionaryInsert(run_t* run) { - if (run->global->dictionaryCnt == 0) { + if (run->global->mutate.dictionaryCnt == 0) { mangle_Bit(run); return; } - uint64_t choice = util_rndGet(0, run->global->dictionaryCnt - 1); - struct strings_t* str = TAILQ_FIRST(&run->global->dictq); + uint64_t choice = util_rndGet(0, run->global->mutate.dictionaryCnt - 1); + struct strings_t* str = TAILQ_FIRST(&run->global->mutate.dictq); for (uint64_t i = 0; i < choice; i++) { str = TAILQ_NEXT(str, pointers); } @@ -127,15 +127,15 @@ static void mangle_DictionaryInsert(run_t* run) { } static void mangle_Dictionary(run_t* run) { - if (run->global->dictionaryCnt == 0) { + if (run->global->mutate.dictionaryCnt == 0) { mangle_Bit(run); return; } size_t off = util_rndGet(0, run->dynamicFileSz - 1); - uint64_t choice = util_rndGet(0, run->global->dictionaryCnt - 1); - struct strings_t* str = TAILQ_FIRST(&run->global->dictq); + uint64_t choice = util_rndGet(0, run->global->mutate.dictionaryCnt - 1); + struct strings_t* str = TAILQ_FIRST(&run->global->mutate.dictq); for (uint64_t i = 0; i < choice; i++) { str = TAILQ_NEXT(str, pointers); } @@ -569,7 +569,7 @@ void mangle_mangleContent(run_t* run) { }; /* Max number of stacked changes is 6 */ - uint64_t changesCnt = util_rndGet(1, run->global->mutationsPerRun); + uint64_t changesCnt = util_rndGet(1, run->global->mutate.mutationsPerRun); for (uint64_t x = 0; x < changesCnt; x++) { uint64_t choice = util_rndGet(0, ARRAYSIZE(mangleFuncs) - 1); |