diff options
author | Jason Ekstrand <[email protected]> | 2015-10-05 17:16:02 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-10-08 08:20:31 -0700 |
commit | 9c528f5dfa69fcb4068df736be441c0db19e6e88 (patch) | |
tree | 02ab6d6b46b95fa42768da5230e606b31ba3d78f /src/glsl | |
parent | c8031a879a3f442a4ca43243914c797615110d9b (diff) |
nir/sweep: Reparent the shader name
Previously the name of the nir shader was being freed prematurely during
nir_sweep. Since 756613ed35d the name was later being used to generate
filenames for the optimiser debug output and these would end up with
garbage from the dangling pointer.
Co-authored-by: Neil Roberts <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/nir_sweep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_sweep.c b/src/glsl/nir/nir_sweep.c index d3549756a63..b6ce43b5224 100644 --- a/src/glsl/nir/nir_sweep.c +++ b/src/glsl/nir/nir_sweep.c @@ -154,6 +154,8 @@ nir_sweep(nir_shader *nir) /* First, move ownership of all the memory to a temporary context; assume dead. */ ralloc_adopt(rubbish, nir); + ralloc_steal(nir, (char *)nir->info.name); + /* Variables and registers are not dead. Steal them back. */ steal_list(nir, nir_variable, &nir->uniforms); steal_list(nir, nir_variable, &nir->inputs); |