From: Kenneth Graunke Date: Tue, 17 Sep 2013 06:41:57 +0000 (-0700) Subject: i965: Fix brw_gs_prog_data_compare to actually check field members. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f64bb2312dece0bba02bcbaf0c48d27d2f69daf;p=mesa.git i965: Fix brw_gs_prog_data_compare to actually check field members. &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. Not a candidate for stable since GS code doesn't exist in 9.2. Signed-off-by: Kenneth Graunke Reviewed-by: Chad Versace --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c b/src/mesa/drivers/dri/i965/brw_vec4_gs.c index 30989c3faef..064e541624d 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_gs.c +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs.c @@ -316,7 +316,7 @@ brw_gs_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_gs_prog_data) - offset)) { return false; }