[qfcc] Check for procedures properly in return value

I guess either I goofed and thought void functions had no return type at
all, or at one stage that was the case, but either way, I had never
tested procedures.
This commit is contained in:
Bill Currie 2024-12-08 19:17:24 +09:00
parent 35c0b84ccc
commit 7379b1226d

View file

@ -243,7 +243,7 @@ static symbol_t *
function_value (function_t *func) function_value (function_t *func)
{ {
symbol_t *ret = 0; symbol_t *ret = 0;
if (func->type->func.ret_type) { if (!is_void (func->type->func.ret_type)) {
ret = symtab_lookup (func->locals, ".ret"); ret = symtab_lookup (func->locals, ".ret");
if (!ret || ret->table != func->locals) { if (!ret || ret->table != func->locals) {
ret = new_symbol_type (".ret", func->type->func.ret_type); ret = new_symbol_type (".ret", func->type->func.ret_type);