[PATCH] D52721: [Preprocessor] Fix a crash when handling non-alpha include header.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 1 05:18:27 PDT 2018


sammccall added inline comments.


================
Comment at: lib/Lex/PPDirectives.cpp:1891
       StringRef OriginalFilename = Filename;
       if (!File) {
+        while (!Filename.empty() && !isAlphanumeric(Filename.front())) {
----------------
everything in this block is guarded by !Filename.empty().
Just add it to the if condition?


================
Comment at: lib/Lex/PPDirectives.cpp:1925
 
+  if (Filename.empty())
+    return;
----------------
this is mysterious - what does it solve? is it the right place to handle this problem?

(You allude to a code complete crash - can you explain?)


Repository:
  rC Clang

https://reviews.llvm.org/D52721





More information about the cfe-commits mailing list