Compiler segfault when splatting variable that does not exist in untyped vaarg macro #2509

This commit is contained in:
Christoffer Lerno
2025-10-03 14:08:19 +02:00
parent e0fbe31f00
commit 87c1e09a7a
3 changed files with 11 additions and 1 deletions

View File

@@ -48,6 +48,7 @@
- Dead code analysis with labelled `if` did not work properly.
### Stdlib changes
- Added AES encryption functions.
- Added generic `InterfaceList` to store a list of values that implement a specific interface
- Added `path::home_directory`, `path::documents_directory`, `path::videos_directory`, `path::pictures_directory`, `path::desktop_directory`, `path::screenshots_directory`,
`path::public_share_directory`, `path::templates_directory`, `path::saved_games_directory`, `path::music_directory`, `path::downloads_directory`.
@@ -150,6 +151,7 @@
- Fix missing end of line when encountering errors in project creation.
- Const enum methods are not being recognized. #2445
- $defined returns an error when assigning a struct initializer with an incorrect type #2449
- Compiler segfault when splatting variable that does not exist in untyped vaarg macro #2509
### Stdlib changes
- Add `==` to `Pair`, `Triple` and TzDateTime. Add print to `Pair` and `Triple`.

View File

@@ -1781,7 +1781,7 @@ static Decl *sema_find_splat_arg(Decl *macro, const char *name)
{
FOREACH(Decl *, decl, macro->func_decl.signature.params)
{
if (decl->name == name) return decl;
if (decl && decl->name == name) return decl;
}
return NULL;
}

View File

@@ -0,0 +1,8 @@
macro test1(...) {}
macro test(...) => test1(...args); // #error: 'args' could not be found
fn int main(String[] args)
{
test();
return 0;
}