mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
gvariant: Add an assertion to clarify some tuple logic
This should quell a scan-build error about dereferencing `member_info` when it’s `NULL` at the end of the function, due to having zero iterations of the `for` loop. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
146a0a001d
commit
e5771df643
@ -983,6 +983,10 @@ gvs_tuple_needed_size (GVariantTypeInfo *type_info,
|
||||
|
||||
offset = 0;
|
||||
|
||||
/* We must go through at least one iteration below. If the tuple had no
|
||||
* children, it would have a fixed size. */
|
||||
g_assert (n_children > 0);
|
||||
|
||||
for (i = 0; i < n_children; i++)
|
||||
{
|
||||
guint alignment;
|
||||
|
Loading…
Reference in New Issue
Block a user