about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-11-10 14:46:01 +0100
committerGitHub <noreply@github.com>2022-11-10 14:46:01 +0100
commitc24939e8122589f5f2e25822eca4bbd14ea1c425 (patch)
tree11e0a850756f6dd7f88eba74341b8be6ae225e10 /src
parentb868758cd72f78f853aa92b74425d4bfb3a47254 (diff)
parentc1562a7cdef10762e6ac712ecf5c51e035b72260 (diff)
downloadafl++-c24939e8122589f5f2e25822eca4bbd14ea1c425.tar.gz
Merge pull request #1576 from AFLplusplus/persistent_mode_always
Persistent mode always
Diffstat (limited to 'src')
-rw-r--r--src/afl-cc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c
index c67d8a8f..1c3b5405 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -1166,6 +1166,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
       "({ static volatile char *_B __attribute__((used,unused)); "
       " _B = (char*)\"" PERSIST_SIG
       "\"; "
+      "extern int __afl_connected;"
 #ifdef __APPLE__
       "__attribute__((visibility(\"default\"))) "
       "int _L(unsigned int) __asm__(\"___afl_persistent_loop\"); "
@@ -1173,7 +1174,8 @@ static void edit_params(u32 argc, char **argv, char **envp) {
       "__attribute__((visibility(\"default\"))) "
       "int _L(unsigned int) __asm__(\"__afl_persistent_loop\"); "
 #endif                                                        /* ^__APPLE__ */
-      "_L(_A); })";
+      // if afl is connected, we run _A times, else once.
+      "_L(__afl_connected ? _A : 1); })";
 
   cc_params[cc_par_cnt++] =
       "-D__AFL_INIT()="