[Mesa-stable] [PATCH] i965: Fix brw_vs_prog_data_compare to actually check field members.

Kenneth Graunke kenneth at whitecape.org
Mon Sep 16 22:48:56 PDT 2013


&a and &b are the address of the local stack variables, not the actual
structures.  Instead of comparing the fields of a and b, we compared
...some stack memory.

Caught by Valgrind on Piglit's glsl-lod-bias test (among many others).

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: mesa-stable at lists.freedesktop.org
---
 src/mesa/drivers/dri/i965/brw_vs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index d5909a5..f5bf590 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -188,7 +188,7 @@ brw_vs_prog_data_compare(const void *in_a, const void *in_b,
 
    /* Compare the rest of the struct. */
    const unsigned offset = sizeof(struct brw_vec4_prog_data);
-   if (memcmp(((char *) &a) + offset, ((char *) &b) + offset,
+   if (memcmp(((char *) a) + offset, ((char *) b) + offset,
               sizeof(struct brw_vs_prog_data) - offset)) {
       return false;
    }
-- 
1.8.3.4



More information about the mesa-stable mailing list