mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[qfcc] Dereference constructor parameters
Sometimes, premature optimization can help, but whatever. Finally, alias.vert compiles, but the output is fairly broken (incorrect handling of `return` and the parameters aren't initialized).
This commit is contained in:
parent
3eef231d70
commit
ae0cfe47cc
1 changed files with 6 additions and 0 deletions
|
@ -253,6 +253,12 @@ math_constructor (const type_t *type, const expr_t *params, const expr_t *e)
|
|||
const expr_t *param_exprs[num_param + 1] = {};
|
||||
list_scatter_rev (¶ms->list, param_exprs);
|
||||
|
||||
for (int i = 0; i < num_param; i++) {
|
||||
if (is_reference (get_type (param_exprs[i]))) {
|
||||
param_exprs[i] = pointer_deref (param_exprs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (num_param == 1 && is_scalar (get_type (param_exprs[0]))) {
|
||||
if (is_matrix (type)) {
|
||||
return construct_diagonal (type, param_exprs[0], e);
|
||||
|
|
Loading…
Reference in a new issue