Mesa (master): glsl: check if return_deref in lower_subroutine_visitor:: visit_leave isn't NULL

Dave Airlie airlied at kemper.freedesktop.org
Thu Aug 20 23:26:34 UTC 2015


Module: Mesa
Branch: master
Commit: 6921f170b62d9f9c0e5bd2cb6666c15395addba8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6921f170b62d9f9c0e5bd2cb6666c15395addba8

Author: Kai Wasserbäch <kai at dev.carbon-project.org>
Date:   Fri Aug 14 14:49:43 2015 +0200

glsl: check if return_deref in lower_subroutine_visitor::visit_leave isn't NULL

Fixes a crash in Piglit's
spec at arb_shader_subroutine@linker at no-mutual-recursion.vert for me.

Signed-off-by: Kai Wasserbäch <kai at dev.carbon-project.org>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 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 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)




More information about the mesa-commit mailing list