mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Fix segfault in unlimited params
This commit is contained in:
parent
c61d0b6ff0
commit
2d52da9c0d
1 changed files with 3 additions and 2 deletions
|
@ -330,8 +330,9 @@ find_function (expr_t *fexpr, expr_t *params)
|
||||||
return e;
|
return e;
|
||||||
type.t.func.num_params++;
|
type.t.func.num_params++;
|
||||||
}
|
}
|
||||||
if (type.t.func.num_params > MAX_PARMS)
|
i = type.t.func.num_params * sizeof (type_t);
|
||||||
return fexpr;
|
type.t.func.param_types = alloca(i);
|
||||||
|
memset (type.t.func.param_types, 0, i);
|
||||||
for (i = 0, e = params; e; i++, e = e->next) {
|
for (i = 0, e = params; e; i++, e = e->next) {
|
||||||
type.t.func.param_types[type.t.func.num_params - 1 - i] = get_type (e);
|
type.t.func.param_types[type.t.func.num_params - 1 - i] = get_type (e);
|
||||||
if (e->type == ex_error)
|
if (e->type == ex_error)
|
||||||
|
|
Loading…
Reference in a new issue