diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index d49f4f2c2ed..f4684377582 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -271,7 +271,7 @@ nir_shader_add_variable(nir_shader *shader, nir_variable *var) nir_variable * nir_variable_create_zeroed(nir_shader *nir) { - return rzalloc(nir, nir_variable); + return gc_zalloc_size(nir->gctx, sizeof(nir_variable), 8); } void diff --git a/src/compiler/nir/nir_sweep.c b/src/compiler/nir/nir_sweep.c index c64bde183f2..d4a22c276f4 100644 --- a/src/compiler/nir/nir_sweep.c +++ b/src/compiler/nir/nir_sweep.c @@ -54,7 +54,7 @@ sweep_constant(nir_shader *nir, nir_constant *c) static void sweep_variable(nir_shader *nir, nir_variable *var) { - ralloc_steal(nir, var); + gc_mark_live(nir->gctx, var); nir_variable_steal_name(nir, var, var); ralloc_steal(nir, var->max_ifc_array_access); ralloc_steal(nir, var->state_slots);