Mesa (master): radeonsi: bail out instead of crashing if the main shader part failed to compile
Nicolai Hähnle
nh at kemper.freedesktop.org
Thu Jul 27 19:17:50 UTC 2017
Module: Mesa
Branch: master
Commit: 06e20c4b8c59104b789981e6d98f3d13bfa8d69f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=06e20c4b8c59104b789981e6d98f3d13bfa8d69f
Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date: Fri Jul 14 15:10:58 2017 +0200
radeonsi: bail out instead of crashing if the main shader part failed to compile
Reviewed: Marek Olšák <marek.olsak at amd.com>
---
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 4a36923ae8..35bdd85afc 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -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;
More information about the mesa-commit
mailing list