Index: tools/gn/tokenizer.cc |
diff --git a/tools/gn/tokenizer.cc b/tools/gn/tokenizer.cc |
index be3223b5e145e48bfc4db5dc6311f88856557b70..db10f6ae094946c11b659aca6dea43f207459f61 100644 |
--- a/tools/gn/tokenizer.cc |
+++ b/tools/gn/tokenizer.cc |
@@ -128,7 +128,8 @@ std::vector<Token> Tokenizer::Run() { |
location.line_number() || |
tokens_.back().location().char_offset() != location.char_offset())) { |
type = Token::LINE_COMMENT; |
- Advance(); // The current \n. |
+ if (!at_end()) // Could be EOF. |
+ Advance(); // The current \n. |
// If this comment is separated from the next syntax element, then we |
// want to tag it as a block comment. This will become a standalone |
// statement at the parser level to keep this comment separate, rather |