mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-13 19:40:34 +01:00
pvr: Pad rogue_regarray_cache_key union members to avoid UB
GCC zeroes out the unreferenced parts of the union when assigning by the smaller member, but clang doesn't. Neither is wrong, because the C standard calls this UB; insert padding to ensure any compiler behaves predictably. Signed-off-by: Matt Coster <matt.coster@imgtec.com> Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Reviewed-by: Simon Perretta <simon.perretta@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24477>
This commit is contained in:
parent
e15832e6f4
commit
06c8ebaa66
1 changed files with 1 additions and 0 deletions
|
|
@ -237,6 +237,7 @@ struct rogue_regarray_cache_key {
|
|||
uint32_t start_index;
|
||||
enum rogue_reg_class class;
|
||||
uint16_t size;
|
||||
uint8_t __pad;
|
||||
} PACKED;
|
||||
|
||||
uint64_t val;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue