Skip to contentSkip to conversation

vmstate: type-check sub-arrays

PATCH In review Paolo Bonzini 2 participants 2 messages Jan 7, 2015 – Jan 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmstate: type-check sub-arrays

While we cannot check against the type of the full array, we can check against the type of the fields.

---
 include/migration/vmstate.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/migration/vmstate.h +1 -1
index 3b9e0de..6097b94 100644
@@ -189,7 +189,7 @@ extern const VMStateInfo vmstate_info_bitmap;
      type_check_2darray(_type, typeof_field(_state, _field), _n1, _n2))
 
 #define vmstate_offset_sub_array(_state, _field, _type, _start)      \
-    (offsetof(_state, _field[_start]))
+    vmstate_offset_value(_state, _field[_start], _type)
 
 #define vmstate_offset_buffer(_state, _field)                        \
     vmstate_offset_array(_state, _field, uint8_t,                    \
Signature · 1 line
1.8.3.1