1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

LibCpp: Don't crash on an empty '#' line

Closes #5634
This commit is contained in:
Itamar 2021-03-04 13:23:24 +02:00 committed by Andreas Kling
parent 3f0ace6670
commit 289c466fef

View file

@ -67,6 +67,8 @@ void Preprocessor::handle_preprocessor_line(const StringView& line)
lexer.consume_specific('#');
consume_whitespace();
auto keyword = lexer.consume_until(' ');
if (keyword.is_empty() || keyword.is_null() || keyword.is_whitespace())
return;
if (keyword == "include") {
consume_whitespace();