summaryrefslogtreecommitdiffstats
path: root/src/glsl/lower_subroutine.cpp
diff options
context:
space:
mode:
authorKai Wasserbäch <kai@dev.carbon-project.org>2015-08-14 14:49:43 +0200
committerDave Airlie <airlied@redhat.com>2015-08-21 09:23:52 +1000
commit6921f170b62d9f9c0e5bd2cb6666c15395addba8 (patch)
treeb71b3a717e10da64eaafb6a23fcc34f69dbe4647 /src/glsl/lower_subroutine.cpp
parent3e6adbd761f72b612aba57fd86bb5203aae07133 (diff)
downloadexternal_mesa3d-6921f170b62d9f9c0e5bd2cb6666c15395addba8.zip
external_mesa3d-6921f170b62d9f9c0e5bd2cb6666c15395addba8.tar.gz
external_mesa3d-6921f170b62d9f9c0e5bd2cb6666c15395addba8.tar.bz2
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 <kai@dev.carbon-project.org> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/glsl/lower_subroutine.cpp')
-rw-r--r--src/glsl/lower_subroutine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/lower_subroutine.cpp b/src/glsl/lower_subroutine.cpp
index b29912a..c1aed61 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)