diff --git a/.pick_status.json b/.pick_status.json index 663b01e32a9..c0ad666436b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1034,7 +1034,7 @@ "description": "nir/sweep: fix use-after-free with dominance LCA", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "17876a00afabc9466162187c18f04080353575d2", "notes": null diff --git a/src/compiler/nir/nir_sweep.c b/src/compiler/nir/nir_sweep.c index d4a22c276f4..0bba79450a5 100644 --- a/src/compiler/nir/nir_sweep.c +++ b/src/compiler/nir/nir_sweep.c @@ -164,6 +164,12 @@ sweep_impl(nir_shader *nir, nir_function_impl *impl) /* Wipe out all the metadata, if any. */ nir_progress(true, impl, nir_metadata_none); + + /* These will be reallocated if needed. NULL them out so we don't + * use-after-free later. + */ + impl->dom_lca_info.table.table = NULL; + impl->dom_lca_info.block_from_idx = NULL; } static void