From: Samuel Pitoiset Date: Mon, 4 Dec 2017 14:32:58 +0000 (+0100) Subject: radv: fix a crash in radv_can_dump_shader() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5de7c782fbb30dc49d6b48f797db8f551dada50a;p=mesa.git radv: fix a crash in radv_can_dump_shader() module can be NULL, oops. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 91f2e7f2a12..f6486863f88 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