mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 15:41:59 +00:00
[qfcc] Make is_function_call a little more useful
It can (and must) be used one level higher as it checks that the expression is a block and that its result expression is call branch expression.
This commit is contained in:
parent
eee6744656
commit
084c2ccb1f
2 changed files with 6 additions and 2 deletions
|
@ -1796,6 +1796,10 @@ has_function_call (expr_t *e)
|
||||||
int
|
int
|
||||||
is_function_call (expr_t *e)
|
is_function_call (expr_t *e)
|
||||||
{
|
{
|
||||||
|
if (e->type != ex_block || !e->e.block.is_call) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
e = e->e.block.result;
|
||||||
return e->type == ex_branch && e->e.branch.type == pr_branch_call;
|
return e->type == ex_branch && e->e.branch.type == pr_branch_call;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -249,8 +249,8 @@ message_expr (expr_t *receiver, keywordarg_t *message)
|
||||||
if (call->type == ex_error)
|
if (call->type == ex_error)
|
||||||
return receiver;
|
return receiver;
|
||||||
|
|
||||||
if (!is_function_call (call->e.block.result)) {
|
if (!is_function_call (call)) {
|
||||||
internal_error (call, "unexpected block result type");
|
internal_error (call, "unexpected call expression type");
|
||||||
}
|
}
|
||||||
call->e.block.result->e.branch.ret_type = return_type;
|
call->e.block.result->e.branch.ret_type = return_type;
|
||||||
return call;
|
return call;
|
||||||
|
|
Loading…
Reference in a new issue