+ /* check that the let_value references a known variable or NULL */
+ for (i = 0; i < stmts->let.count; ++i) {
+ let_stmt *let = stmts->let.list[i];
+ int check = 0;
+
+ if (let->val->var) {
+ for (j = 0; j < impl->func->args->count; ++j) {
+ impl_arg *iarg = impl->func->args->args[j];
+
+ if (!strcmp(let->val->var->name, iarg->var->name)) {
+ let->arg = iarg;
+ check = 1;
+ break;
+ }
+ }
+ if (!check) {
+ V->error(PSI_WARNING, "Unknown value '$%s' of `let` statement"
+ " for variable '%s' of implementation '%s'",
+ let->val->var->name, let->var->name, impl->func->name);
+ return 0;
+ }
+ }
+ }