Skip to content

Commit 0820ccb

Browse files
committed
Fix ICE when parsing an invalid terse function initializer
Closes #1006
1 parent a330403 commit 0820ccb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

source/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"9712:0834"
1+
"9712:0850"

source/parse.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8575,7 +8575,9 @@ class parser
85758575
{
85768576
n->equal_sign = curr().position();
85778577
n->initializer = statement(/*ignore semicolon_required*/ false, n->equal_sign);
8578-
assert( n->initializer && "ICE: should have already validated that there's a valid expression-statement here" );
8578+
if (!n->initializer) {
8579+
return {};
8580+
}
85798581
}
85808582

85818583
else

0 commit comments

Comments
 (0)