Workaround a miscompilation by gcc-4.3 that showed up as a failure
authorDuncan Sands <baldrick@free.fr>
Fri, 24 Feb 2012 09:01:34 +0000 (09:01 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 24 Feb 2012 09:01:34 +0000 (09:01 +0000)
of the StringRef.Split2 unittest on 32 bit machines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151358 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/StringRef.cpp

index 0227b9c2190477b367e6ad25dc4db908eb52a055..44e732540351e14287ec5857d40b2328643d1a44 100644 (file)
@@ -241,7 +241,7 @@ void StringRef::split(SmallVectorImpl<StringRef> &A,
        ++splits) {
     std::pair<StringRef, StringRef> p = rest.split(Separators);
 
-    if (p.first.size() != 0 || KeepEmpty)
+    if (KeepEmpty || p.first.size() != 0)
       A.push_back(p.first);
     rest = p.second;
   }