Skip to content

pvr: Pad rogue_regarray_cache_key union members to avoid UB

Matt Coster requested to merge MTCoster/mesa:dev/pad-union into main

What does this MR do and why?

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>
Edited by Matt Coster

Merge request reports