d3dcompiler: Iterate through the instruction list in reverse in free_instr_list() (Valgrind).

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-08-10 11:11:35 -05:00 committed by Alexandre Julliard
parent cb8de48f77
commit 23cc300372
1 changed files with 3 additions and 1 deletions

View File

@ -2113,7 +2113,9 @@ void free_instr_list(struct list *list)
if (!list)
return;
LIST_FOR_EACH_ENTRY_SAFE(node, next_node, list, struct hlsl_ir_node, entry)
/* Iterate in reverse, to avoid use-after-free when unlinking sources from
* the "uses" list. */
LIST_FOR_EACH_ENTRY_SAFE_REV(node, next_node, list, struct hlsl_ir_node, entry)
free_instr(node);
d3dcompiler_free(list);
}