OSDN Git Service

radeonsi: bail out instead of crashing if the main shader part failed to compile
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 14 Jul 2017 13:10:58 +0000 (15:10 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 27 Jul 2017 19:16:45 +0000 (21:16 +0200)
Reviewed: Marek Olšák <marek.olsak@amd.com>

src/gallium/drivers/radeonsi/si_shader.c

index 4a36923..35bdd85 100644 (file)
@@ -7379,6 +7379,9 @@ int si_shader_create(struct si_screen *sscreen, LLVMTargetMachineRef tm,
                 * the previous shader stage.
                 */
 
+               if (!mainp)
+                       return -1;
+
                /* Copy the compiled TGSI shader data over. */
                shader->is_binary_shared = true;
                shader->binary = mainp->binary;