zink: also replace hash_entry::key when replacing separable program
this otherwise still points to the separable program's shader array and will access freed memory Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
This commit is contained in:
committed by
Marge Bot
parent
b5029a90df
commit
b73fe8d52e
@@ -699,6 +699,7 @@ zink_gfx_program_update_optimal(struct zink_context *ctx)
|
||||
if (util_queue_fence_is_signalled(&prog->base.cache_fence)) {
|
||||
struct zink_gfx_program *real = prog->full_prog;
|
||||
entry->data = real;
|
||||
entry->key = real->shaders;
|
||||
real->base.removed = false;
|
||||
prog->full_prog = NULL;
|
||||
prog->base.removed = true;
|
||||
@@ -737,6 +738,7 @@ zink_gfx_program_update_optimal(struct zink_context *ctx)
|
||||
struct hash_entry *entry = _mesa_hash_table_search_pre_hashed(ht, hash, ctx->gfx_stages);
|
||||
struct zink_gfx_program *real = prog->full_prog;
|
||||
entry->data = real;
|
||||
entry->key = real->shaders;
|
||||
real->base.removed = false;
|
||||
prog->full_prog = NULL;
|
||||
prog->base.removed = true;
|
||||
|
||||
Reference in New Issue
Block a user