================
@@ -466,6 +466,9 @@ SourceLocation
 Preprocessor::CheckEndOfDirective(StringRef DirType, bool EnableMacros,
                                   SmallVectorImpl<Token> *ExtraToks) {
   Token Tmp;
+  // Avoid use-of-uninitialized-memory for edge case(s) where there is no extra
+  // token to be parsed.
+  Tmp.setKind(tok::eod);
----------------
yronglin wrote:

This fix looks make sense. Can we use `Tmp.startToken();` instead? Then other 
members in `Token` will be initialized too. WDYT? 

https://github.com/llvm/llvm-project/pull/188590
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to