[qfcc] Set the return of Ruamoko calls

Of course, I had the width of opc wrong :P. But with this, it seems that
unoptimized calls should work once I get the stack frame working.
This commit is contained in:
Bill Currie 2022-01-21 13:50:21 +09:00
parent 33a3f92503
commit c53127707b
2 changed files with 9 additions and 2 deletions

View file

@ -114,7 +114,7 @@ call_formats = {
"mnemonic": "call",
"opname": "call",
"format": "{call_fmt[mm]}",
"widths": "{call_widths[mm]}, 0",
"widths": "{call_widths[mm]}, -1",
"types": "{call_types[mm]}, ev_void",
"args": {
"op_mode": ".BCD",

View file

@ -1115,7 +1115,14 @@ expr_call (sblock_t *sblock, expr_t *call, operand_t **op)
}
statement_t *s = new_statement (st_func, "call", call);
sblock = statement_subexpr (sblock, func, &s->opa);
s->opc = short_operand (0, call);
if (!op) {
s->opc = short_operand (0, call);
} else {
if (!*op) {
*op = temp_operand (call->e.branch.ret_type, call);
}
s->opc = *op;
}
sblock_add_statement (sblock, s);
sblock->next = new_sblock ();
return sblock->next;