Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3dcompiler_43/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 336bf0d9bcf..df39716b495 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -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); }