- attrdef with any invalid name causes compiler assert #2128.

This commit is contained in:
Christoffer Lerno
2025-05-12 01:41:19 +02:00
parent 83955ea5b5
commit c528f53d58
3 changed files with 13 additions and 3 deletions

View File

@@ -10,8 +10,9 @@
- Assert triggered when casting from `int[2]` to `uint[2]` #2115
- Assert when a macro with compile time value is discarded, e.g. `foo();` where `foo()` returns an untyped list. #2117
- Fix stringify for compound initializers #2120.
- Fix No index OOB check for `[:^n]` #2123
- Fix regression in Time diff due to operator overloading #2124
- Fix No index OOB check for `[:^n]` #2123.
- Fix regression in Time diff due to operator overloading #2124.
- attrdef with any invalid name causes compiler assert #2128.
### Stdlib changes
- Added `String.quick_ztr` and `String.is_zstr`

View File

@@ -2209,7 +2209,7 @@ static inline Decl *parse_attrdef(ParseContext *c)
Decl *decl = decl_new(DECL_ATTRIBUTE, symstr(c), c->span);
advance_and_verify(c, TOKEN_AT_TYPE_IDENT);
TRY_CONSUME_OR_RET(TOKEN_AT_TYPE_IDENT, "Expected an attribute type name, like '@MyAttr'.", poisoned_decl);
if (try_consume(c, TOKEN_LPAREN))
{

View File

@@ -0,0 +1,9 @@
attrdef @FOO = @test; // #error: Expected an
attrdef 1 = @test; // #error: Expected an
attrdef @foo = @test; // #error: Expected an
attrdef foo = @test; // #error: Expected an
attrdef $foo = @test; // #error: Expected an
attrdef #foo = @test; // #error: Expected an
attrdef "foo" = @test; // #error: Expected an
attrdef 'f' = @test; // #error: Expected an