When a global const has invalid attributes, handling is incorrect, leading to a crash #2785.

This commit is contained in:
Christoffer Lerno
2026-01-21 00:43:30 +01:00
parent 472124dab3
commit 5fa820a462
3 changed files with 3 additions and 1 deletions

View File

@@ -1007,7 +1007,7 @@ Decl *parse_const_declaration(ParseContext *c, bool is_global, bool is_extern)
// Differentiate between global and local attributes, global have visibility
if (is_global)
{
if (!parse_attributes_for_global(c, decl)) return false;
if (!parse_attributes_for_global(c, decl)) return poisoned_decl;
}
else
{