<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 16, 2016 at 12:50 PM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Operations like nir_op_bitfield_insert have four arguments, leading to<br>
memory corruption.<br>
<br>
Found by Coverity (CID 1358582).<br>
---<br>
src/compiler/spirv/spirv_to_nir.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c<br>
index c65f971..56948bf 100644<br>
--- a/src/compiler/spirv/spirv_to_nir.c<br>
+++ b/src/compiler/spirv/spirv_to_nir.c<br>
@@ -1036,7 +1036,7 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,<br>
unsigned bit_size =<br>
glsl_get_bit_size(val->const_type);<br>
<br>
- nir_const_value src[3];<br>
+ nir_const_value src[4];<br></blockquote><div><br></div><div>While I'm sure coverity can't see this, it's not actually a bug. All of the opcodes that will ever be used here have 1 or 2 arguments with the single exception of bcsel.<br><br></div><div>I don't have a problem with expanding the array but it's not a bug.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
assert(count <= 7);<br>
for (unsigned i = 0; i < count - 4; i++) {<br>
nir_constant *c =<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.3<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>