mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 21:48:04 +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>
This commit is contained in:
parent
ed51e9ae43
commit
6773ffa758
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