nir: Allocate nir_call_instr::params out of the nir_call itself.
The lifetime of the params array needs to be match the nir_call_instr itself. So, allocate it using the instruction itself as the context. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
73d106822e
commit
b05d53404c
|
@ -445,7 +445,7 @@ nir_call_instr_create(void *mem_ctx, nir_function_overload *callee)
|
|||
|
||||
instr->callee = callee;
|
||||
instr->num_params = callee->num_params;
|
||||
instr->params = ralloc_array(mem_ctx, nir_deref_var *, instr->num_params);
|
||||
instr->params = ralloc_array(instr, nir_deref_var *, instr->num_params);
|
||||
instr->return_deref = NULL;
|
||||
|
||||
return instr;
|
||||
|
|
Loading…
Reference in New Issue