Hello Nico Huber, Martin Roth, Patrick Georgi, Angel Pons, Arthur Heymans, Iru Cai (vimacs), HAOUAS Elyes,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44573
to look at the new patch set (#2).
Change subject: include/list.h: Add support for GCC9+ ......................................................................
include/list.h: Add support for GCC9+
When getting the address of a structure's member that is not on offset 0, GCC9+ assumes that the address never can be NULL. However the code relied on the fact that it can be NULL by letting the pointer intentionally overflow.
Manually calculate the address using uintptr_t. This allows to gracefully terminate the list_for_each MACRO instead of crashing at the end of the list.
Tested on qemu-system-arm: coreboot no longer crashed in the devicetree parser and is able to boot Linux 5.5.
Change-Id: I0d569b59a23d1269f8575fcbbe92a5a6816aa1f7 Signed-off-by: Patrick Rudolph siro@das-labor.org --- M src/include/list.h 1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/44573/2