From: Nicolai Hähnle Date: Fri, 31 Mar 2017 11:03:03 +0000 (+0200) Subject: radeonsi: cope with missing disassembly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6588d9962e8bf3965f2d333101ea8179a176d19;p=mesa.git radeonsi: cope with missing disassembly For robustness and testing purposes. Reviewed-by: Marek Olšák --- 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 =