[llvm] r214210 - Fix FileCheck crash when empty prefix is passed.
Eli Bendersky
eliben at google.com
Tue Jul 29 13:30:53 PDT 2014
Author: eliben
Date: Tue Jul 29 15:30:53 2014
New Revision: 214210
URL: http://llvm.org/viewvc/llvm-project?rev=214210&view=rev
Log:
Fix FileCheck crash when empty prefix is passed.
Modified:
llvm/trunk/utils/FileCheck/FileCheck.cpp
Modified: llvm/trunk/utils/FileCheck/FileCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileCheck/FileCheck.cpp?rev=214210&r1=214209&r2=214210&view=diff
==============================================================================
--- llvm/trunk/utils/FileCheck/FileCheck.cpp (original)
+++ llvm/trunk/utils/FileCheck/FileCheck.cpp Tue Jul 29 15:30:53 2014
@@ -1212,6 +1212,10 @@ static bool ValidateCheckPrefixes() {
I != E; ++I) {
StringRef Prefix(*I);
+ // Reject empty prefixes.
+ if (Prefix == "")
+ return false;
+
if (!PrefixSet.insert(Prefix))
return false;
More information about the llvm-commits
mailing list