Fix crash on 'destroy' with return type and no params (#5527)

Fuzzer-found crash
This commit is contained in:
Jon Ross-Perkins authored and GitHub committed 2025-05-23 19:33:06 +00:00
1 parent 95ce06a7a4
commit 90649d60f0
2 files changed
+16 -1

No files matched your search

+3 -1
View File
@@ -64,7 +64,9 @@ auto HandleParseNode(Context& context, Parse::ReturnTypeId node_id) -> bool {
// not on the pattern stacks yet. They are only needed in that case if we have
// a return type, which we now know that we do.
if (context.node_stack().PeekNodeKind() ==
Parse::NodeKind::IdentifierNameNotBeforeParams) {
Parse::NodeKind::IdentifierNameNotBeforeParams ||
context.node_stack().PeekNodeKind() ==
Parse::NodeKind::KeywordNameNotBeforeParams) {
context.pattern_block_stack().Push();
context.full_pattern_stack().PushFullPattern(
FullPatternStack::Kind::ExplicitParamList);