[PATCH] D53509: Add unsgined char StringRef constructor/Fix llvm-strings crash

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 01:59:01 PDT 2018


jhenderson added inline comments.


================
Comment at: tools/llvm-strings/llvm-strings.cpp:84
+  for (const unsigned char *P = B; P < E; ++P) {
     if (std::isgraph(*P) || std::isblank(*P)) {
       if (S == nullptr)
----------------
efriedma wrote:
> Could we just use something like `if (isPrint(*P) || *P == '\t')` to avoid the issue?  std::isgraph has other issues (see r338034).
Yes, I think we can, and that then solves the need for the new `StringRef` constructor. I'll update.


Repository:
  rL LLVM

https://reviews.llvm.org/D53509





More information about the llvm-commits mailing list