Skip to content

Commit ad2eaf5

Browse files
committed
fix multiple loading of allow/denylist and do proper counting
1 parent a287076 commit ad2eaf5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

instrumentation/afl-llvm-common.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ bool isIgnoreFunction(const llvm::Function *F) {
168168

169169
void initInstrumentList() {
170170

171+
static int init = 0;
172+
if (init) return;
173+
init = 1;
174+
171175
char *allowlist = getenv("AFL_LLVM_ALLOWLIST");
172176
if (!allowlist) allowlist = getenv("AFL_LLVM_INSTRUMENT_FILE");
173177
if (!allowlist) allowlist = getenv("AFL_LLVM_WHITELIST");
@@ -250,7 +254,7 @@ void initInstrumentList() {
250254

251255
if (debug)
252256
DEBUGF("loaded allowlist with %zu file and %zu function entries\n",
253-
allowListFiles.size() / 4, allowListFunctions.size() / 4);
257+
allowListFiles.size(), allowListFunctions.size());
254258

255259
}
256260

@@ -325,7 +329,7 @@ void initInstrumentList() {
325329

326330
if (debug)
327331
DEBUGF("loaded denylist with %zu file and %zu function entries\n",
328-
denyListFiles.size() / 4, denyListFunctions.size() / 4);
332+
denyListFiles.size(), denyListFunctions.size());
329333

330334
}
331335

0 commit comments

Comments
 (0)