<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 3, 2016 at 10:56 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There may not be a previous block. In this case, there's no real work<br>
to do, so just continue on to the next one.<br>
<br>
v2: Update for bblock->prev() API change.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp | 4 ++++<br>
1 file changed, 4 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp<br>
index 2c1abaf..114dc6c 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp<br>
@@ -42,6 +42,10 @@ dead_control_flow_eliminate(backend_shader *s)<br>
<br>
foreach_block_safe (block, s->cfg) {<br>
bblock_t *prev_block = block->prev();<br>
+<br>
+ if (!prev_block)<br>
+ continue;<br>
+<br>
backend_instruction *const inst = block->start();<br>
backend_instruction *const prev_inst = prev_block->end();<br></blockquote><div><br></div><div>Yeah, that guy right there will be a problem on the first loop iteration every time. I've seen this in valgrind quite a bit lately. Thanks for fixing it!<br><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div><div>Maybe Cc stable?<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.7.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>