[YAMLTraits] - Revert a change committed by a mistake in D68983
authorgeorgerim <georgerim@gmail.com>
Sat, 26 Oct 2019 11:52:12 +0000 (14:52 +0300)
committergeorgerim <georgerim@gmail.com>
Sat, 26 Oct 2019 11:52:12 +0000 (14:52 +0300)
I've accidentally reverted one of my previous patches.
It was not catched by bots because (I guess) they do not
build in debug (we have a test case which triggers an assert
in MSVS when runs without this change).
More info: https://reviews.llvm.org/D68983#inline-624235

Reported by Jordan Rupprecht.

llvm/include/llvm/Support/YAMLTraits.h

index 656020e..a3bfa7d 100644 (file)
@@ -649,7 +649,8 @@ inline bool isBool(StringRef S) {
 inline QuotingType needsQuotes(StringRef S) {
   if (S.empty())
     return QuotingType::Single;
-  if (isspace(S.front()) || isspace(S.back()))
+  if (isspace(static_cast<unsigned char>(S.front())) ||
+      isspace(static_cast<unsigned char>(S.back())))
     return QuotingType::Single;
   if (isNull(S))
     return QuotingType::Single;