- /* first find the decl of the free func */
- if (!locate_free_decl(data->decls, free_call)) {
- data->error(data, free_call->token, PSI_WARNING,
- "Missing declaration '%s' in `free` statement"
- " of implementation '%s'",
- free_call->func, impl->func->name);
- return 0;
- }
-
-
-
- /* now check for known vars */
- for (l = 0; l < free_call->vars->count; ++l) {
- int check = 0;
- decl_var *free_var = free_call->vars->vars[l];
-
- if (!strcmp(free_var->name, impl->decl->func->var->name)) {
- check = 1;
- free_var->arg = impl->decl->func;
- } else if (impl->decl->args) {
- for (k = 0; k < impl->decl->args->count; ++k) {
- decl_arg *free_arg = impl->decl->args->args[k];
-
- if (!strcmp(free_var->name, free_arg->var->name)) {
- check = 1;
- free_var->arg = free_arg;
- break;
- }
- }
- }
-
- if (!check) {
- data->error(data, free_var->token, PSI_WARNING,
- "Unknown variable '%s' of `free` statement"
- " of implementation '%s'",
- free_var->name, impl->func->name);
- return 0;
- }
- }
- }