From d60ac111e67161215a601f70e1bcd6125c9825f7 Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Mon, 15 Apr 2019 22:51:53 +0000 Subject: Revert [Support] Fix recursive response file expansion guard This reverts r358452 (git commit c8df4fb9c3865eac52a99602c26bbc070098c3d4) A dependent commit breaks the Windows buildbots. llvm-svn: 358460 --- llvm/lib/Support/CommandLine.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'llvm/lib/Support/CommandLine.cpp') diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 0050002..98d06f6 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -1040,7 +1040,7 @@ static bool ExpandResponseFile(StringRef FName, StringSaver &Saver, bool cl::ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl &Argv, bool MarkEOLs, bool RelativeNames) { - unsigned ExpandedRspFiles = 0; + unsigned RspFiles = 0; bool AllExpanded = true; // Don't cache Argv.size() because it can change. @@ -1058,16 +1058,14 @@ bool cl::ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer, // If we have too many response files, leave some unexpanded. This avoids // crashing on self-referential response files. - if (ExpandedRspFiles > 20) + if (RspFiles++ > 20) return false; // Replace this response file argument with the tokenization of its // contents. Nested response files are expanded in subsequent iterations. SmallVector ExpandedArgv; - if (ExpandResponseFile(Arg + 1, Saver, Tokenizer, ExpandedArgv, MarkEOLs, - RelativeNames)) { - ++ExpandedRspFiles; - } else { + if (!ExpandResponseFile(Arg + 1, Saver, Tokenizer, ExpandedArgv, + MarkEOLs, RelativeNames)) { // We couldn't read this file, so we leave it in the argument stream and // move on. AllExpanded = false; -- cgit v1.1