diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-11-17 20:01:50 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2017-11-29 19:36:24 +0000 |
commit | f7687449701b4e08c3a96a765f6425677a1b4c67 (patch) | |
tree | 6c59ee8c8c50e5120f869e285ef696c6e865f96a | |
parent | 1e908f5035a84684798f270b500561f0d9290635 (diff) |
st_glsl_to_tgsi: check for the tail sentinel in merge_two_dsts
This fixes yet another case where DFRACEXP has only one destination. Found
by address sanitizer.
Fixes tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-mantissa.shader_test
Fixes: 3b666aa74795 ("st/glsl_to_tgsi: fix DFRACEXP with only one destination")
Acked-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 7e35bdad1c67d7df2832ac4b39bff471e83812e5)
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index a45f0047a8a..42cda05c4bc 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -5222,7 +5222,7 @@ glsl_to_tgsi_visitor::merge_two_dsts(void) defined = 0; inst2 = (glsl_to_tgsi_instruction *) inst->next; - do { + while (!inst2->is_tail_sentinel()) { if (inst->op == inst2->op && inst2->dst[defined].file == PROGRAM_UNDEFINED && inst->src[0].file == inst2->src[0].file && @@ -5231,9 +5231,9 @@ glsl_to_tgsi_visitor::merge_two_dsts(void) inst->src[0].swizzle == inst2->src[0].swizzle) break; inst2 = (glsl_to_tgsi_instruction *) inst2->next; - } while (inst2); + } - if (!inst2) { + if (inst2->is_tail_sentinel()) { /* Undefined destinations are not allowed, substitute with an unused * temporary register. */ |