microsoft/clc: Fix const violations from ralloc_steal

Fixes: ff05da7f8d ("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>
This commit is contained in:
Jesse Natalie 2020-11-19 14:44:08 -08:00 committed by Marge Bot
parent e33cb6a763
commit dcd8adcc28

View file

@ -515,8 +515,8 @@ clc_context_new(const struct clc_logger *logger, const struct clc_context_option
if (options && options->optimize)
clc_context_optimize(s);
ralloc_steal(ctx, s);
ctx->libclc_nir = s;
ralloc_steal(ctx, ctx->libclc_nir);
return ctx;
}
@ -559,13 +559,14 @@ struct clc_context *
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;
}