mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 17:26:17 +01:00
gtype: Move an assertion to help out the static analyser
scan-build is worried that `node->data->common.value_table->value_init` will be a `NULL` pointer dereference in the assignment to `node->mutatable_check_cache`. There’s already an assertion immediately below to check against this, so let’s move it up a line to help the static analyser out. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #1767
This commit is contained in:
parent
6a1beede60
commit
70a49e35cc
@ -1197,12 +1197,12 @@ type_data_make_W (TypeNode *node,
|
||||
if (value_table->lcopy_format)
|
||||
strcat (p, value_table->lcopy_format);
|
||||
}
|
||||
|
||||
node->data->common.value_table = vtable;
|
||||
g_assert (node->data->common.value_table != NULL); /* paranoid */
|
||||
node->mutatable_check_cache = (node->data->common.value_table->value_init != NULL &&
|
||||
!((G_TYPE_FLAG_VALUE_ABSTRACT | G_TYPE_FLAG_ABSTRACT) &
|
||||
GPOINTER_TO_UINT (type_get_qdata_L (node, static_quark_type_flags))));
|
||||
|
||||
g_assert (node->data->common.value_table != NULL); /* paranoid */
|
||||
|
||||
g_atomic_int_set ((int *) &node->ref_count, 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user