diff options
author | Matt Morehouse <mascasa@google.com> | 2017-12-05 17:13:17 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2017-12-05 17:13:17 +0000 |
commit | de09e9c079964dd99b360aeb1220c4233352eeb9 (patch) | |
tree | 6ebf54604cbebe629d4634044aec1b8b7d69b511 /lib/fuzzer/FuzzerCommand.h | |
parent | ebc7f4959ad5b862f4e3e40dc3fdb900b0a3ace2 (diff) |
[libFuzzer] Make redirects happen in proper sequence.
"> file" must come before "2>&1" to have redirection occur correctly in
all cases. Fixes a regression on minimize_two_crashes.test.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerCommand.h')
-rw-r--r-- | lib/fuzzer/FuzzerCommand.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/fuzzer/FuzzerCommand.h b/lib/fuzzer/FuzzerCommand.h index 358f89094..c5500ed21 100644 --- a/lib/fuzzer/FuzzerCommand.h +++ b/lib/fuzzer/FuzzerCommand.h @@ -143,10 +143,10 @@ public: std::stringstream SS; for (auto arg : getArguments()) SS << arg << " "; - if (isOutAndErrCombined()) - SS << "2>&1 "; if (hasOutputFile()) SS << ">" << getOutputFile() << " "; + if (isOutAndErrCombined()) + SS << "2>&1 "; std::string result = SS.str(); if (!result.empty()) result = result.substr(0, result.length() - 1); |