summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-11-06 11:12:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-11-06 12:16:09 +0000
commitcc68b830edb0ce15b6c1695d87e76d8968632744 (patch)
tree3c70c738e24035b900d3e3407e1a4c557ecc37ce /desktop
parenta9c3e2d27f8e4a9cac6866d4d03f289aff49bf4d (diff)
afl-event-testing: afl-1.93b has a new persistent pattern
some testing shows that I can reliably hit at least 1000 pseudo-restarts without failures, so bump from 100 to 1000 Change-Id: Ib72c74068793ea1090a7b99a566372dc943641e6
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx26
1 files changed, 8 insertions, 18 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 4dbe67a35c69..aa1a77676608 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1274,31 +1274,21 @@ struct ExecuteGlobals
static ExecuteGlobals* pExecGlobals = NULL;
-#define PERSIST_MAX 100
-unsigned int persist_cnt;
//This just calls Execute() for all normal uses of LibreOffice, but for
-//ui-testing if AFL_PERSISTENT is set then on exit it will pseudo-restart (up
-//to PERSIST_MAX times)
+//ui-testing if built with afl-clang-fast++ then on exit it will pseudo-restart
+//(up to 100 times)
void Desktop::DoExecute()
{
-try_again:
+#if !defined(__AFL_HAVE_MANUAL_CONTROL)
+ Execute();
+#else
+ while (__AFL_LOOP(1000))
{
Execute();
- /* To signal successful completion of a run, we need to deliver
- SIGSTOP to our own process, then loop to the very beginning
- once we're resumed by the supervisor process. We do this only
- if AFL_PERSISTENT is set to retain normal behavior when the
- program is executed directly; and take note of PERSIST_MAX. */
- if (getenv("AFL_PERSISTENT") && persist_cnt++ < PERSIST_MAX)
- {
- OpenDefault();
-#if defined UNX
- raise(SIGSTOP);
-#endif
- goto try_again;
- }
+ OpenDefault();
}
+#endif
}
int Desktop::Main()