Skip to content

Commit

Permalink
map size fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhauser-thc committed Aug 1, 2019
1 parent 487a87d commit af823d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Version ++2.53d (dev):
----------------------

- custom mutator by a loaded library is now supported (thanks to kyakdan!)
- fix for a few features to support different map sized than 2^16
- afl-showmap: new option -r now shows the real values in the buckets (stock
afl never did), plus shows tuple content summary information now
- fix building on *BSD (thanks to tobias.kortkamp for the patch)
Expand Down
8 changes: 3 additions & 5 deletions llvm_mode/LLVMInsTrim.so.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ namespace {
std::mt19937 generator;
int total_instr = 0;

unsigned genLabel() {
return generator() % 65536;
unsigned int genLabel() {
return generator() &= MAP_SIZE - 1;
}

public:
static char ID;
InsTrim() : ModulePass(ID), generator(0) {//}

// AFLCoverage() : ModulePass(ID) {
InsTrim() : ModulePass(ID), generator(0) {
char* instWhiteListFilename = getenv("AFL_LLVM_WHITELIST");
if (instWhiteListFilename) {
std::string line;
Expand Down
2 changes: 1 addition & 1 deletion qemu_mode/patches/afl-qemu-cpu-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

/* This is equivalent to afl-as.h: */

static unsigned char dummy[65536]; /* costs 64kb but saves a few instructions */
static unsigned char dummy[MAP_SIZE]; /* costs MAP_SIZE but saves a few instructions */
unsigned char *afl_area_ptr = dummy; /* Exported for afl_gen_trace */

/* Exported variables populated by the code patched into elfload.c: */
Expand Down

0 comments on commit af823d6

Please sign in to comment.