nir: Make nir_create_function() strdup the function name.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 28 Mar 2015 02:23:36 +0000 (19:23 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 2 Apr 2015 21:20:00 +0000 (14:20 -0700)
commit587b3a20a1d3201467adf90e66b53b9843b2cc0a
tree77649c9be6db59b3c64053e526928cb262db667b
parentf61b6c3e48071991c098aa588ee86473f419d5c0
nir: Make nir_create_function() strdup the function name.

glsl_to_nir passes in the ir_function's name field; we were copying the
pointer, but not duplicating the memory.

We want to be able to free the linked GLSL IR program after translating
to NIR, so we'll need to create a copy of the function name that the NIR
shader actually owns.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/glsl/nir/nir.c