mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 13:10:34 +00:00
[qfcc] Do not reverse function args in ruamoko call
It messed up the later check for calls to i[super dealloc].
This commit is contained in:
parent
d61e906cb9
commit
baca7cbb4c
1 changed files with 14 additions and 3 deletions
|
@ -1096,7 +1096,7 @@ expr_call (sblock_t *sblock, expr_t *call, operand_t **op)
|
||||||
}
|
}
|
||||||
defspace_t *arg_space = current_func->arguments;
|
defspace_t *arg_space = current_func->arguments;
|
||||||
expr_t *func = call->e.branch.target;
|
expr_t *func = call->e.branch.target;
|
||||||
expr_t *args = call->e.branch.args;
|
expr_t **args = 0;
|
||||||
expr_t *args_va_list = 0; // .args (...) parameter
|
expr_t *args_va_list = 0; // .args (...) parameter
|
||||||
expr_t *args_params = 0; // first arg in ...
|
expr_t *args_params = 0; // first arg in ...
|
||||||
operand_t *use = 0;
|
operand_t *use = 0;
|
||||||
|
@ -1105,9 +1105,20 @@ expr_call (sblock_t *sblock, expr_t *call, operand_t **op)
|
||||||
|
|
||||||
defspace_reset (arg_space);
|
defspace_reset (arg_space);
|
||||||
|
|
||||||
args = reverse_expr_list (args);
|
int num_args = 0;
|
||||||
|
for (expr_t *a = call->e.branch.args; a; a = a->next) {
|
||||||
|
num_args++;
|
||||||
|
}
|
||||||
|
if (num_args) {
|
||||||
|
int i = num_args;
|
||||||
|
args = alloca (num_args * sizeof (expr_t *));
|
||||||
|
for (expr_t *a = call->e.branch.args; a; a = a->next) {
|
||||||
|
args[--i] = a;
|
||||||
|
}
|
||||||
|
}
|
||||||
int arg_num = 0;
|
int arg_num = 0;
|
||||||
for (expr_t *a = args; a; a = a->next) {
|
for (int i = 0; i < num_args; i++) {
|
||||||
|
expr_t *a = args[i];
|
||||||
const char *arg_name = va (0, ".arg%d", arg_num++);
|
const char *arg_name = va (0, ".arg%d", arg_num++);
|
||||||
def_t *def = new_def (arg_name, 0, current_func->arguments,
|
def_t *def = new_def (arg_name, 0, current_func->arguments,
|
||||||
sc_local);
|
sc_local);
|
||||||
|
|
Loading…
Reference in a new issue