mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
The memmove in SetClassGuid at line 684 generates a `store to misaligned address` runtime warning when VfrCompile is compiled with clang UBSan. We can avoid generating code which stores to a misaligned address in a least a couple of other ways than done here, including casting the destination pointer of the memmove to (VOID *), or compiling with `-fno-builtin-memmove`. However, maintaining an unaligned pointer to an aligned type is, strictly speaking, undefined behaviour in the c/c++ standard (regardless of how it is or is not then accessed). So here we resolve the actual incorrect semantics of this part of the code (and thereby fix the unaligned access) by introducing a PACKED_EFI_GUID type in VfrUtilityLib.h, and using it for this unaligned access. Signed-off-by: Mike Beaton <mjsbeaton@gmail.com> |
||
|---|---|---|
| .. | ||
| C | ||
| Python | ||