[PATCH] D49141: Revert "[Fuzzer] Afl driver changing iterations handling"
Matt Morehouse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 10 13:03:47 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL336719: Revert "[Fuzzer] Afl driver changing iterations handling" (authored by morehouse, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D49141
Files:
compiler-rt/trunk/lib/fuzzer/afl/afl_driver.cpp
compiler-rt/trunk/test/fuzzer/afl-driver.test
Index: compiler-rt/trunk/test/fuzzer/afl-driver.test
===================================================================
--- compiler-rt/trunk/test/fuzzer/afl-driver.test
+++ compiler-rt/trunk/test/fuzzer/afl-driver.test
@@ -21,16 +21,9 @@
CHECK3: LLVMFuzzerTestOneInput called; Size = 3
-RUN: not %run %t-AFLDriverTest %t.file3 2>&1 | FileCheck %s --check-prefix=CHECK4
-CHECK4: WARNING: using the deprecated call style `{{.*}} 1000`
-CHECK4: WARNING: iterations invalid `{{.*}}`
+RUN: %run %t-AFLDriverTest %t.file3 2>&1 | FileCheck %s --check-prefix=CHECK4
+CHECK4: LLVMFuzzerTestOneInput called; Size = 3
RUN: %run %t-AFLDriverTest %t.file3 %t.file4 2>&1 | FileCheck %s --check-prefix=CHECK5
CHECK5: LLVMFuzzerTestOneInput called; Size = 3
CHECK5: LLVMFuzzerTestOneInput called; Size = 4
-
-RUN: not %run %t-AFLDriverTest < %t.file3 --1 2>&1 | FileCheck %s --check-prefix=CHECK6
-CHECK6: WARNING: iterations invalid `-1`
-
-RUN: not %run %t-AFLDriverTest < %t.file3 -Invalid 2>&1 | FileCheck %s --check-prefix=CHECK7
-CHECK7: WARNING: iterations invalid `Invalid`
Index: compiler-rt/trunk/lib/fuzzer/afl/afl_driver.cpp
===================================================================
--- compiler-rt/trunk/lib/fuzzer/afl/afl_driver.cpp
+++ compiler-rt/trunk/lib/fuzzer/afl/afl_driver.cpp
@@ -59,7 +59,6 @@
#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>
-#include <limits.h>
#include <fstream>
#include <iostream>
@@ -306,18 +305,6 @@
return 0;
}
-static void set_iterations(int *N, const char *arg) {
- char *next_char;
- long NL = strtol(arg, &next_char, 10);
- if (NL < 1 || NL > INT_MAX || *next_char != '\0') {
- fprintf(stderr, "WARNING: iterations invalid `%s`\n",
- arg);
- ::exit(-1);
- }
-
- *N = static_cast<int>(NL);
-}
-
int main(int argc, char **argv) {
fprintf(stderr,
"======================= INFO =========================\n"
@@ -344,12 +331,11 @@
int N = 1000;
if (argc == 2 && argv[1][0] == '-')
- set_iterations(&N, argv[1] + 1);
- else if(argc == 2) {
- fprintf(stderr, "WARNING: using the deprecated call style `%s %d`\n",
- argv[0], N);
- set_iterations(&N, argv[1]);
- } else if (argc > 1)
+ N = atoi(argv[1] + 1);
+ else if(argc == 2 && (N = atoi(argv[1])) > 0)
+ fprintf(stderr, "WARNING: using the deprecated call style `%s %d`\n",
+ argv[0], N);
+ else if (argc > 1)
return ExecuteFilesOnyByOne(argc, argv);
assert(N > 0);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49141.154866.patch
Type: text/x-patch
Size: 2492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180710/739ec390/attachment.bin>
More information about the llvm-commits
mailing list