[PATCH] D90759: Escape command line arguments in backtraces

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 06:04:33 PST 2020


jhenderson added a comment.

Seems reasonable overall. Just a coupel of nits.



================
Comment at: llvm/lib/Support/PrettyStackTrace.cpp:257
   // Print the argument list.
-  for (unsigned i = 0, e = ArgC; i != e; ++i)
-    OS << ArgV[i] << ' ';
+  for (int I = 0; I < ArgC; ++I) {
+    const bool HaveSpace = ::strchr(ArgV[I], ' ');
----------------
What's the reason for changing the type of `I`? It's being used as an incrementing array index, so size_t seems like the most appropriate thing, if you're going to change it at all.


================
Comment at: llvm/lib/Support/PrettyStackTrace.cpp:264
+      OS << '"';
+    OS << ' ';
+  }
----------------
It would be nice to not have this trailing space after the last argument.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90759/new/

https://reviews.llvm.org/D90759



More information about the llvm-commits mailing list