Revision 1229e46d3cfe61ee0b11f08fbbc7530af1578637 authored by Peter Maydell on 16 October 2018, 17:09:38 UTC, committed by Kevin Wolf on 05 November 2018, 14:09:54 UTC
Taking the address of a field in a packed struct is a bad idea, because
it might not be actually aligned enough for that pointer type (and
thus cause a crash on dereference on some host architectures). Newer
versions of clang warn about this. Avoid the bug by not using the
"modify in place" byte swapping functions.

There are a few places where the in-place swap function is
used on something other than a packed struct field; we convert
those anyway, for consistency.

Patch produced with scripts/coccinelle/inplace-byteswaps.cocci.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
1 parent c317b64
History
File Mode Size
aarch64-core.xml -rw-r--r-- 1.5 KB
aarch64-fpu.xml -rw-r--r-- 3.3 KB
arm-core.xml -rw-r--r-- 1.1 KB
arm-neon.xml -rw-r--r-- 3.9 KB
arm-vfp.xml -rw-r--r-- 1.2 KB
arm-vfp3.xml -rw-r--r-- 2.0 KB
cf-core.xml -rw-r--r-- 1.1 KB
cf-fp.xml -rw-r--r-- 1.0 KB
i386-32bit-core.xml -rw-r--r-- 2.7 KB
i386-32bit-sse.xml -rw-r--r-- 2.0 KB
i386-32bit.xml -rw-r--r-- 480 bytes
i386-64bit-core.xml -rw-r--r-- 3.0 KB
i386-64bit-sse.xml -rw-r--r-- 2.4 KB
i386-64bit.xml -rw-r--r-- 477 bytes
m68k-fp.xml -rw-r--r-- 1021 bytes
power-altivec.xml -rw-r--r-- 2.4 KB
power-core.xml -rw-r--r-- 2.1 KB
power-fpu.xml -rw-r--r-- 2.0 KB
power-spe.xml -rw-r--r-- 1.5 KB
power-vsx.xml -rw-r--r-- 2.0 KB
power64-core.xml -rw-r--r-- 2.1 KB
s390-acr.xml -rw-r--r-- 1.4 KB
s390-cr.xml -rw-r--r-- 1.3 KB
s390-fpr.xml -rw-r--r-- 1.4 KB
s390-gs.xml -rw-r--r-- 578 bytes
s390-virt.xml -rw-r--r-- 859 bytes
s390-vx.xml -rw-r--r-- 2.4 KB
s390x-core64.xml -rw-r--r-- 1.5 KB

back to top