diff options
author | Itamar <itamar8910@gmail.com> | 2021-02-10 22:15:38 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-13 19:50:09 +0100 |
commit | 8ace2cfa1848ad4402b0c8ffa1875d6d9bffec10 (patch) | |
tree | e143ccbd7abc8c5acadad70a59f667a2d06ef63b /Userland/Libraries/LibCpp/Lexer.cpp | |
parent | 2da5ecba41ca7cc6212cce8e27e082723e6f6782 (diff) | |
download | serenity-8ace2cfa1848ad4402b0c8ffa1875d6d9bffec10.zip |
LibCpp: Fix lexing & parsing of non-terminated strings
Diffstat (limited to 'Userland/Libraries/LibCpp/Lexer.cpp')
-rw-r--r-- | Userland/Libraries/LibCpp/Lexer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCpp/Lexer.cpp b/Userland/Libraries/LibCpp/Lexer.cpp index 5273f87dd4..0507f11ec3 100644 --- a/Userland/Libraries/LibCpp/Lexer.cpp +++ b/Userland/Libraries/LibCpp/Lexer.cpp @@ -640,6 +640,10 @@ Vector<Token> Lexer::lex() } } + // If string is not terminated - stop before EOF + if (!peek(1)) + break; + if (consume() == '"') break; } |