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 4a36923ae8c1bd5f588a66b6f579b11dc59364bd..35bdd85afcf247dd0588794c0bfddc680cdf0bd7 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;