From c9389db4229cb383432a80986f5f8d3084dde38f Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Thu, 21 May 2015 20:39:13 +0000 Subject: [PATCH] [lib/Fuzzer] ignore flags that start with --; use git pull --rebase instead of just git pull git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237950 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Fuzzer/FuzzerDriver.cpp | 10 ++++++++++ lib/Fuzzer/pull_and_push_fuzz_corpus.sh | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/Fuzzer/FuzzerDriver.cpp b/lib/Fuzzer/FuzzerDriver.cpp index dd0db86e02e..edfe09e8731 100644 --- a/lib/Fuzzer/FuzzerDriver.cpp +++ b/lib/Fuzzer/FuzzerDriver.cpp @@ -75,6 +75,8 @@ static void PrintHelp() { std::cerr << "\t"; std::cerr << D.Default << "\t" << D.Description << "\n"; } + std::cerr << "\nFlags starting with '--' will be ignored and " + "will be passed verbatim to subprocesses.\n"; } static const char *FlagValue(const char *Param, const char *Name) { @@ -87,6 +89,14 @@ static const char *FlagValue(const char *Param, const char *Name) { static bool ParseOneFlag(const char *Param) { if (Param[0] != '-') return false; + if (Param[1] == '-') { + static bool PrintedWarning = false; + if (!PrintedWarning) { + PrintedWarning = true; + std::cerr << "WARNING: libFuzzer ignores flags that start with '--'\n"; + } + return true; + } for (size_t F = 0; F < kNumFlags; F++) { const char *Name = FlagDescriptions[F].Name; const char *Str = FlagValue(Param, Name); diff --git a/lib/Fuzzer/pull_and_push_fuzz_corpus.sh b/lib/Fuzzer/pull_and_push_fuzz_corpus.sh index bd564e3dfe5..05c322c6e5b 100755 --- a/lib/Fuzzer/pull_and_push_fuzz_corpus.sh +++ b/lib/Fuzzer/pull_and_push_fuzz_corpus.sh @@ -8,10 +8,10 @@ cd $1 git add * git commit -m "fuzz test corpus" -git pull --no-edit +git pull --rebase --no-edit for((attempt=0; attempt<5; attempt++)); do echo GIT PUSH $1 ATTEMPT $attempt if $(git push); then break; fi - git pull --no-edit + git pull --rebase --no-edit done -- 2.34.1