[Mesa-dev] [PATCH v2] radv: fix a crash in radv_can_dump_shader()
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Mon Dec 4 18:25:56 UTC 2017
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
On Mon, Dec 4, 2017 at 3:32 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> module can be NULL, oops.
>
> v2: really check that module is not NULL
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/amd/vulkan/radv_shader.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h
> index 91f2e7f2a1..f6486863f8 100644
> --- a/src/amd/vulkan/radv_shader.h
> +++ b/src/amd/vulkan/radv_shader.h
> @@ -118,8 +118,8 @@ radv_can_dump_shader(struct radv_device *device,
> struct radv_shader_module *module)
> {
> /* Only dump non-meta shaders, useful for debugging purposes. */
> - return !module->nir &&
> - device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS;
> + return device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS &&
> + module && !module->nir;
> }
>
> #endif
> --
> 2.15.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list