diff --git a/releasenotes.md b/releasenotes.md index 9ceabef40..63c77c773 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -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`. diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index 4405bfcab..6cad425b3 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -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; } diff --git a/test/test_suite/functions/splat_arg_fail.c3 b/test/test_suite/functions/splat_arg_fail.c3 new file mode 100644 index 000000000..1ed3b743c --- /dev/null +++ b/test/test_suite/functions/splat_arg_fail.c3 @@ -0,0 +1,8 @@ +macro test1(...) {} +macro test(...) => test1(...args); // #error: 'args' could not be found + +fn int main(String[] args) +{ + test(); + return 0; +}