From 537b1f4732d230e60c76a9d1b5d71de44a5098df Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Fri, 14 Jul 2017 15:10:58 +0200 Subject: radeonsi: bail out instead of crashing if the main shader part failed to compile --- src/gallium/drivers/radeonsi/si_shader.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index bbedce8872..09f3c2b731 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -7492,6 +7492,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; -- cgit v1.2.3