Mesa (master): gallium/util: fix undefined shift to the last bit in u_bit_scan

Marek Olšák mareko at kemper.freedesktop.org
Mon Apr 18 17:51:40 UTC 2016


Module: Mesa
Branch: master
Commit: 6dc21b196218e9139d5b3e4a5308fe335fc92cf7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6dc21b196218e9139d5b3e4a5308fe335fc92cf7

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Apr 16 02:09:55 2016 +0200

gallium/util: fix undefined shift to the last bit in u_bit_scan

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/gallium/auxiliary/util/u_math.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 0a82915..d983af3 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -489,7 +489,7 @@ static inline int
 u_bit_scan(unsigned *mask)
 {
    int i = ffs(*mask) - 1;
-   *mask &= ~(1 << i);
+   *mask &= ~(1u << i);
    return i;
 }
 




More information about the mesa-commit mailing list