radv: remove NIR_PASS in radv_nir_lower_rt_abi
When NIR_DEBUG=serialize or NIR_DEBUG=clone is used, NIR_PASS recreates nir_function_impl and nir_variable objects, causing use-after-free since radv_nir_lower_rt_abi() keeps pointers to those in local variables. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Marek Olšák <maraeo@gmail.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37573>
This commit is contained in:
@@ -1992,7 +1992,8 @@ radv_nir_lower_rt_abi(nir_shader *shader, const VkRayTracingPipelineCreateInfoKH
|
||||
}
|
||||
shader->scratch_size = 0;
|
||||
|
||||
NIR_PASS(_, shader, nir_lower_returns);
|
||||
/* This can't use NIR_PASS because NIR_DEBUG=serialize,clone invalidates pointers. */
|
||||
nir_lower_returns(shader);
|
||||
|
||||
nir_cf_list list;
|
||||
nir_cf_extract(&list, nir_before_impl(impl), nir_after_impl(impl));
|
||||
|
||||
Reference in New Issue
Block a user