diff options
| author | Peter Maydell | 2019-07-26 16:40:28 +0200 |
|---|---|---|
| committer | Peter Maydell | 2019-07-26 17:17:56 +0200 |
| commit | 0c413ba0d87c1c0444b5aaec050ba86f33409474 (patch) | |
| tree | bb70eb013b09d26978f24405971ed242a7c7d5fc /scripts/git-submodule.sh | |
| parent | stellaris_input: Fix vmstate description of buttons field (diff) | |
| download | qemu-0c413ba0d87c1c0444b5aaec050ba86f33409474.tar.gz qemu-0c413ba0d87c1c0444b5aaec050ba86f33409474.tar.xz qemu-0c413ba0d87c1c0444b5aaec050ba86f33409474.zip | |
vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros
The VMSTATE_STRUCT_VARRAY_UINT32 macro is intended to handle
migrating a field which is an array of structs, but where instead of
migrating the entire array we only migrate a variable number of
elements of it.
The VMSTATE_STRUCT_VARRAY_POINTER_UINT32 macro is intended to handle
migrating a field which is of pointer type, and points to a
dynamically allocated array of structs of variable size.
We weren't actually checking that the field passed to
VMSTATE_STRUCT_VARRAY_UINT32 really is an array, with the result that
accidentally using it where the _POINTER_ macro was intended would
compile but silently corrupt memory on migration.
Add type-checking that enforces that the field passed in is
really of the right array type. This applies to all the VMSTATE
macros which use flags including VMS_VARRAY_* but not VMS_POINTER.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Tested-by: Damien Hedde <damien.hedde@greensocs.com>
Message-id: 20190725163710.11703-3-peter.maydell@linaro.org
Diffstat (limited to 'scripts/git-submodule.sh')
0 files changed, 0 insertions, 0 deletions
