mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-15 17:08:08 +02:00
libweston: fix bitshift in weston_idalloc_get_id()
Fixes the following UBSan error:
../../git/weston/libweston/id-number-allocator.c:140:16: runtime error:
left shift of 1 by 31 places cannot be represented in type 'int'
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit 6773ffa758)
This commit is contained in:
parent
cb8bb2763a
commit
ef25333fac
1 changed files with 1 additions and 1 deletions
|
|
@ -137,7 +137,7 @@ weston_idalloc_get_id(struct weston_idalloc *idalloc)
|
|||
continue;
|
||||
|
||||
/* Found free id, take it and set it to 1 on the bucket. */
|
||||
*bucket |= 1 << i;
|
||||
*bucket |= (uint32_t)1 << i;
|
||||
id = (32 * idalloc->lowest_free_bucket) + i;
|
||||
|
||||
/* Bucket may become full... */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue