Mesa (main): intel/tools: fix left shift overflow on 32-bit

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 28 09:43:53 UTC 2021


Module: Mesa
Branch: main
Commit: 53c49ce41f3c8aba7d5dbcbacdcc34c3536f34a4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=53c49ce41f3c8aba7d5dbcbacdcc34c3536f34a4

Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date:   Thu Jun 24 13:15:55 2021 +0200

intel/tools: fix left shift overflow on 32-bit

gcc complains:
../src/intel/tools/aub_write.c:394:53: warning: left shift count >= width of type [-Wshift-count-overflow]
  394 |    assert((aub->phys_addrs_allocator + size) < (1UL << 32));
      |                                                     ^~

Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11574>

---

 src/intel/tools/aub_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/tools/aub_write.c b/src/intel/tools/aub_write.c
index ca3592ffdb7..e9443c5b82d 100644
--- a/src/intel/tools/aub_write.c
+++ b/src/intel/tools/aub_write.c
@@ -391,7 +391,7 @@ aub_map_ggtt(struct aub_file *aub, uint64_t virt_addr, uint64_t size)
     * receive from error2aub are page aligned.
     */
    assert(virt_addr % 4096 == 0);
-   assert((aub->phys_addrs_allocator + size) < (1UL << 32));
+   assert((aub->phys_addrs_allocator + size) < (1ULL << 32));
 
    /* GGTT PT */
    uint32_t ggtt_ptes = DIV_ROUND_UP(size, 4096);



More information about the mesa-commit mailing list