mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Compiler segfault when splatting variable that does not exist in untyped vaarg macro #2509
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
8
test/test_suite/functions/splat_arg_fail.c3
Normal file
8
test/test_suite/functions/splat_arg_fail.c3
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user