From 6921f170b62d9f9c0e5bd2cb6666c15395addba8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kai=20Wasserb=C3=A4ch?= Date: Fri, 14 Aug 2015 14:49:43 +0200 Subject: [PATCH] glsl: check if return_deref in lower_subroutine_visitor::visit_leave isn't NULL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes a crash in Piglit's spec@arb_shader_subroutine@linker@no-mutual-recursion.vert for me. Signed-off-by: Kai Wasserbäch Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie --- src/glsl/lower_subroutine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/lower_subroutine.cpp b/src/glsl/lower_subroutine.cpp index b29912ad150..c1aed61a36a 100644 --- a/src/glsl/lower_subroutine.cpp +++ b/src/glsl/lower_subroutine.cpp @@ -98,7 +98,7 @@ lower_subroutine_visitor::visit_leave(ir_call *ir) else last_branch = if_tree(equal(subr_to_int(var), lc), new_call, last_branch); - if (s > 0) + if (return_deref && s > 0) return_deref = return_deref->clone(mem_ctx, NULL); } if (last_branch) -- 2.30.2