Re: [Mesa-dev] [PATCH 1/2] swrast: fix undefined shift of 1 << 31

2019-04-11 Thread Eric Engestrom
On Thursday, 2019-04-11 20:40:13 +1000, Dave Airlie wrote:
> From: Dave Airlie 
> 
> Pointed out by coverity

Series is:
Reviewed-by: Eric Engestrom 

> ---
>  src/mesa/swrast/s_span.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
> index f50b549a97f..184a37c99b8 100644
> --- a/src/mesa/swrast/s_span.c
> +++ b/src/mesa/swrast/s_span.c
> @@ -769,7 +769,7 @@ clip_span( struct gl_context *ctx, SWspan *span )
>* For arrays of values, shift them left.
>*/
>   for (i = 0; i < VARYING_SLOT_MAX; i++) {
> -if (span->interpMask & (1 << i)) {
> +if (span->interpMask & (1u << i)) {
> GLuint j;
> for (j = 0; j < 4; j++) {
>span->attrStart[i][j] += leftClip * span->attrStepX[i][j];
> -- 
> 2.20.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 1/2] swrast: fix undefined shift of 1 << 31

2019-04-11 Thread Dave Airlie
From: Dave Airlie 

Pointed out by coverity
---
 src/mesa/swrast/s_span.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index f50b549a97f..184a37c99b8 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -769,7 +769,7 @@ clip_span( struct gl_context *ctx, SWspan *span )
   * For arrays of values, shift them left.
   */
  for (i = 0; i < VARYING_SLOT_MAX; i++) {
-if (span->interpMask & (1 << i)) {
+if (span->interpMask & (1u << i)) {
GLuint j;
for (j = 0; j < 4; j++) {
   span->attrStart[i][j] += leftClip * span->attrStepX[i][j];
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev