1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

LibCpp: Set end position for the return type node of FunctionType nodes

Previously we didn't set the end position for the return type node of
function FunctionType nodes.

This caused a VERIFY failure crash when dumping an AST that contains
such nodes.
This commit is contained in:
Itamar 2022-02-27 19:31:50 +02:00 committed by Andreas Kling
parent fa384c8171
commit abc420b15a

View file

@ -1260,6 +1260,7 @@ NonnullRefPtr<Type> Parser::parse_type(ASTNode& parent)
}
if (peek().type() == Token::Type::LeftParen) {
type->set_end(previous_token_end());
consume();
auto fn_type = create_ast_node<FunctionType>(parent, type->start(), position());
fn_type->set_return_type(*type);