From 4e990b67cef9a90f362e5a3791234ef779f47bea Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 21 Jul 2016 21:58:56 -0700 Subject: [PATCH] i965: Fix undefined signed overflow in INTEL_MASK for bitfields of 31 bits. Most likely we had only ever used this macro on bitfields of less than 31 bits -- That's going to change shortly. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 3d97fda8415..f2994cb8ebd 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -29,7 +29,7 @@ * Keith Whitwell */ -#define INTEL_MASK(high, low) (((1<<((high)-(low)+1))-1)<<(low)) +#define INTEL_MASK(high, low) (((1u<<((high)-(low)+1))-1)<<(low)) /* Using the GNU statement expression extension */ #define SET_FIELD(value, field) \ ({ \ -- 2.30.2