gsocketaddress: Add an assertion to help static analysis

The static analyser will check dynamic type assertions and assume that
if they fail, the variable can either have the wrong type, or be NULL
(which is correct). The analyser doesn’t know that other constraints in
the API ensure the variable is non-NULL.

Add a non-null assertion to help the static analyser and shut it up in
this case.

https://bugzilla.gnome.org/show_bug.cgi?id=113075
This commit is contained in:
Philip Withnall 2013-11-26 11:09:58 +00:00
parent c729f416fb
commit 956c58c7f2

View File

@ -386,6 +386,8 @@ g_socket_address_connectable_proxy_enumerate (GSocketConnectable *connectable)
{ {
GSocketAddressEnumerator *addr_enum = NULL; GSocketAddressEnumerator *addr_enum = NULL;
g_assert (connectable != NULL);
if (G_IS_INET_SOCKET_ADDRESS (connectable) && if (G_IS_INET_SOCKET_ADDRESS (connectable) &&
!G_IS_PROXY_ADDRESS (connectable)) !G_IS_PROXY_ADDRESS (connectable))
{ {