Berry fix potential crash when parsing unfinished strings

This commit is contained in:
Stephan Hadinger 2022-07-07 13:24:03 +02:00
parent 61734674c5
commit 9f8fffd6ba

View File

@ -419,6 +419,9 @@ static btokentype scan_string(blexer *lexer)
save(lexer); /* skip '\\.' */
}
}
if (c == EOS) {
be_lexerror(lexer, "unfinished string");
}
c = next(lexer); /* skip '"' or '\'' */
/* check if there's an additional string literal right after */
skip_delimiter(lexer);