summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-14 15:10:58 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-14 15:10:58 +0200
commit537b1f4732d230e60c76a9d1b5d71de44a5098df (patch)
treec119e453d5c794b832a64c58fa5070859681cb1b
parent8be9149fb3f4fb295eaaa0c371bfa9552e1945ce (diff)
radeonsi: bail out instead of crashing if the main shader part failed to compiletmp
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c3
1 files changed, 3 insertions, 0 deletions
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;