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:
Kenneth Graunke 2015-04-07 00:32:55 -07:00
parent 73d106822e
commit b05d53404c
1 changed files with 1 additions and 1 deletions

View File

@ -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;