radeonsi: cope with missing disassembly
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 31 Mar 2017 11:03:03 +0000 (13:03 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 14 Apr 2017 20:51:07 +0000 (22:51 +0200)
For robustness and testing purposes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 78c7495ce8f39dd6e9f58a8197185a282eed0a18..c52ffd90f760a37bffe86aa15cc171d9a056e3fb 100644 (file)
@@ -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 =