-
-static inline int validate_impl_stmts(PSI_Validator *V, impl *impl, impl_stmts *stmts) {
- /* okay,
- * - we must have exactly one ret stmt delcaring the native func to call and which type cast to apply
- * - we can have multiple let stmts; every arg of the ret stmts var (the function to call) must have one
- * - we can have any count of set stmts; processing out vars
- * - we can have any count of free stmts; freeing any out vars
- */
- size_t i, j, k;
- return_stmt *ret;
- decl *decl;
-
- if (!stmts) {
- V->error(PSI_WARNING, "Missing body for implementation %s!",
- impl->func->name);
- return 0;
- }
- if (stmts->ret.count != 1) {
- if (stmts->ret.count > 1) {
- V->error(PSI_WARNING, "Too many `ret` statements for implmentation %s;"
- "found %zu, exactly one is needed",
- impl->func->name, stmts->ret.count);
+static inline int validate_impl_ret_stmt(PSI_Validator *V, impl *impl) {
+ /* we must have exactly one ret stmt delcaring the native func to call */
+ /* and which type cast to apply */
+ if (impl->stmts->ret.count != 1) {
+ if (impl->stmts->ret.count > 1) {
+ V->error(PSI_WARNING, "Too many `return` statements for implmentation %s;"
+ " found %zu, exactly one is needed",
+ impl->func->name, impl->stmts->ret.count);