diff --git a/.release-notes/4278.md b/.release-notes/4278.md new file mode 100644 index 0000000000..32067dc2d8 --- /dev/null +++ b/.release-notes/4278.md @@ -0,0 +1,3 @@ +## Fix crash when handling parameters with invalid types + +Fixes a compiler assert when checking a parameter for autorecovery that has an invalid type. diff --git a/src/libponyc/expr/call.c b/src/libponyc/expr/call.c index 0e64135f18..6921b4490c 100644 --- a/src/libponyc/expr/call.c +++ b/src/libponyc/expr/call.c @@ -281,7 +281,7 @@ static bool check_arg_types(pass_opt_t* opt, ast_t* params, ast_t* positional, errorframe_t info = NULL; ast_t* wp_type = consume_type(p_type, TK_NONE, false); - if(check_auto_recover_newref(wp_type, arg)) + if((wp_type != NULL) && check_auto_recover_newref(wp_type, arg)) { token_id arg_cap = ast_id(cap_fetch(wp_type)); ast_t* recovered_arg_type = recover_type(arg_type, arg_cap);