[llvm] r237950 - [lib/Fuzzer] ignore flags that start with --; use git pull --rebase instead of just git pull
Kostya Serebryany
kcc at google.com
Thu May 21 13:39:13 PDT 2015
Author: kcc
Date: Thu May 21 15:39:13 2015
New Revision: 237950
URL: http://llvm.org/viewvc/llvm-project?rev=237950&view=rev
Log:
[lib/Fuzzer] ignore flags that start with --; use git pull --rebase instead of just git pull
Modified:
llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp
llvm/trunk/lib/Fuzzer/pull_and_push_fuzz_corpus.sh
Modified: llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp?rev=237950&r1=237949&r2=237950&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp Thu May 21 15:39:13 2015
@@ -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
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);
Modified: llvm/trunk/lib/Fuzzer/pull_and_push_fuzz_corpus.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/pull_and_push_fuzz_corpus.sh?rev=237950&r1=237949&r2=237950&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/pull_and_push_fuzz_corpus.sh (original)
+++ llvm/trunk/lib/Fuzzer/pull_and_push_fuzz_corpus.sh Thu May 21 15:39:13 2015
@@ -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
More information about the llvm-commits
mailing list