Fixes:
ff05da7f8dc ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7697>
if (options && options->optimize)
clc_context_optimize(s);
+ ralloc_steal(ctx, s);
ctx->libclc_nir = s;
- ralloc_steal(ctx, ctx->libclc_nir);
return ctx;
}
struct blob_reader tmp;
blob_reader_init(&tmp, serialized, serialized_size);
- ctx->libclc_nir = nir_deserialize(NULL, libclc_nir_options, &tmp);
- if (!ctx->libclc_nir) {
- free(ctx);
+ nir_shader *s = nir_deserialize(NULL, libclc_nir_options, &tmp);
+ if (!s) {
+ ralloc_free(ctx);
return NULL;
}
- ralloc_steal(ctx, ctx->libclc_nir);
+ ralloc_steal(ctx, s);
+ ctx->libclc_nir = s;
return ctx;
}