[PATCH] D60382: FileCheck [2/12]: Stricter parsing of -D option

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 02:02:59 PDT 2019


thopre marked an inline comment as done.
thopre added inline comments.


================
Comment at: llvm/lib/Support/FileCheck.cpp:58-60
+  // Name can't start with a digit.
+  if (isdigit(static_cast<unsigned char>(Name[0])))
+    return true;
----------------
arsenm wrote:
> I think this should be split into a separate isValidVarNameStart function or something. I would also invert this to be a whitelist. We probably also need to at least disallow $, @, +, - and :
I'm not sure what you mean by invert to a whitelist. Do you mean:

Name[0] == '_' || isalpha(Name[0])

? Regarding $, @, +, - and : I believe they are already rejected by the line above checking for isalnum or '_', isn't it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60382





More information about the llvm-commits mailing list