mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
nir: avoiding reading unitialized memory when using nir_dest_copy
Deeper in chain of calls, function "src_has_indirect" is used (which
reads "is_ssa" and "reg.indirect").
Fixes: d1eae6f36b ("nir: Properly clean up nir_src/dest indirects")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13317>
This commit is contained in:
parent
9539315f97
commit
28a6e45a0f
1 changed files with 2 additions and 2 deletions
|
|
@ -376,7 +376,7 @@ void nir_src_copy(nir_src *dest, const nir_src *src)
|
|||
dest->reg.base_offset = src->reg.base_offset;
|
||||
dest->reg.reg = src->reg.reg;
|
||||
if (src->reg.indirect) {
|
||||
dest->reg.indirect = malloc(sizeof(nir_src));
|
||||
dest->reg.indirect = calloc(1, sizeof(nir_src));
|
||||
nir_src_copy(dest->reg.indirect, src->reg.indirect);
|
||||
} else {
|
||||
dest->reg.indirect = NULL;
|
||||
|
|
@ -396,7 +396,7 @@ void nir_dest_copy(nir_dest *dest, const nir_dest *src)
|
|||
dest->reg.base_offset = src->reg.base_offset;
|
||||
dest->reg.reg = src->reg.reg;
|
||||
if (src->reg.indirect) {
|
||||
dest->reg.indirect = malloc(sizeof(nir_src));
|
||||
dest->reg.indirect = calloc(1, sizeof(nir_src));
|
||||
nir_src_copy(dest->reg.indirect, src->reg.indirect);
|
||||
} else {
|
||||
dest->reg.indirect = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue