X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftypes%2Freturn_stmt.c;h=8ff646d3d9448eea3f400df7c548ccab3e94283e;hb=09529efcde471127419e141807b83b37077003a0;hp=b4bcb523d6f42b2ed104d2a5eb9051f33a233014;hpb=c9384515a81cb64d345b299908b2852f51bb8e6e;p=m6w6%2Fext-psi diff --git a/src/types/return_stmt.c b/src/types/return_stmt.c index b4bcb52..8ff646d 100644 --- a/src/types/return_stmt.c +++ b/src/types/return_stmt.c @@ -46,9 +46,7 @@ void psi_return_stmt_free(struct psi_return_stmt **ret_ptr) struct psi_return_stmt *ret = *ret_ptr; *ret_ptr = NULL; - if (ret->token) { - free(ret->token); - } + psi_token_free(&ret->token); psi_return_exp_free(&ret->exp); free(ret); } @@ -78,12 +76,12 @@ bool psi_return_stmt_validate(struct psi_data *data, data->error(data, ret->token, PSI_WARNING, "Too many `return` statements for implementation %s;" " found %zu, exactly one is required", - scope->impl->func->name, count); + scope->impl->func->name->val, count); return false; case 0: data->error(data, scope->impl->func->token, PSI_WARNING, "Missing `return` statement for implementation %s", - scope->impl->func->name); + scope->impl->func->name->val); return false; case 1: break;