[PATCH] D27923: [libFuzzer] Diff 28 - Update platform flags in the afl driver.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 08:41:31 PST 2016


mpividori created this revision.
mpividori added reviewers: kcc, zturner.
mpividori added a subscriber: llvm-commits.
mpividori set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

https://reviews.llvm.org/D27923

Files:
  lib/Fuzzer/afl/afl_driver.cpp


Index: lib/Fuzzer/afl/afl_driver.cpp
===================================================================
--- lib/Fuzzer/afl/afl_driver.cpp
+++ lib/Fuzzer/afl/afl_driver.cpp
@@ -49,6 +49,25 @@
 statistics from the file. If that fails then the process will quit.
 
 */
+// Platform detection. Copied from FuzzerInternal.h
+#ifdef __linux__
+#define LIBFUZZER_APPLE 0
+#define LIBFUZZER_LINUX 1
+#define LIBFUZZER_WINDOWS 0
+#elif __APPLE__
+#define LIBFUZZER_APPLE 1
+#define LIBFUZZER_LINUX 0
+#define LIBFUZZER_WINDOWS 0
+#elif _WIN32
+#define LIBFUZZER_APPLE 0
+#define LIBFUZZER_LINUX 0
+#define LIBFUZZER_WINDOWS 1
+#else
+#error "Support for your platform has not been implemented"
+#endif
+
+#define LIBFUZZER_POSIX LIBFUZZER_APPLE || LIBFUZZER_LINUX
+
 #include <assert.h>
 #include <chrono>
 #include <iostream>
@@ -60,16 +79,6 @@
 #include <errno.h>
 #include <signal.h>
 #include <sys/resource.h>
-// Platform detection. Copied from FuzzerInternal.h
-#ifdef __linux__
-#define LIBFUZZER_LINUX 1
-#define LIBFUZZER_APPLE 0
-#elif __APPLE__
-#define LIBFUZZER_LINUX 0
-#define LIBFUZZER_APPLE 1
-#else
-#error "Support for your platform has not been implemented"
-#endif
 
 // Used to avoid repeating error checking boilerplate. If cond is false, a
 // fatal error has occured in the program. In this event print error_message


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27923.81958.patch
Type: text/x-patch
Size: 1334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161219/61f8f705/attachment.bin>


More information about the llvm-commits mailing list