From d6588d9962e8bf3965f2d333101ea8179a176d19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 31 Mar 2017 13:03:03 +0200 Subject: [PATCH] radeonsi: cope with missing disassembly MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit For robustness and testing purposes. Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_state_shaders.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 78c7495ce8f..c52ffd90f76 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -113,7 +113,8 @@ static void *si_get_shader_binary(struct si_shader *shader) /* There is always a size of data followed by the data itself. */ unsigned relocs_size = shader->binary.reloc_count * sizeof(shader->binary.relocs[0]); - unsigned disasm_size = strlen(shader->binary.disasm_string) + 1; + unsigned disasm_size = shader->binary.disasm_string ? + strlen(shader->binary.disasm_string) + 1 : 0; unsigned llvm_ir_size = shader->binary.llvm_ir_string ? strlen(shader->binary.llvm_ir_string) + 1 : 0; unsigned size = -- 2.30.2