From: Kai Wasserbäch Date: Fri, 14 Aug 2015 12:49:43 +0000 (+0200) Subject: glsl: check if return_deref in lower_subroutine_visitor::visit_leave isn't NULL X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6921f170b62d9f9c0e5bd2cb6666c15395addba8;p=mesa.git glsl: check if return_deref in lower_subroutine_visitor::visit_leave isn't NULL 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 --- 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)