After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755374 - g_variant_get_child(): flatten-first logic on '&'
g_variant_get_child(): flatten-first logic on '&'
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gvariant
unspecified
Other All
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-09-21 20:57 UTC by Allison Karlitskaya (desrt)
Modified: 2015-09-29 14:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
g_variant_get_child(): flatten-first logic on '&' (1.18 KB, patch)
2015-09-21 20:57 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2015-09-21 20:57:50 UTC
Copy the flatten-first logic from g_variant_get(), and for the same
reason: if the user is requesting a direct pointer access to a
tree-based child inside of argument to this function then that child
could disappear later.

Forcing serialisation means that the pointer will remain valid as long
as the passed-in instance exists, which is the usual expectation with
GVariant API.
Comment 1 Allison Karlitskaya (desrt) 2015-09-21 20:57:57 UTC
Created attachment 311804 [details] [review]
g_variant_get_child(): flatten-first logic on '&'
Comment 2 Lars Karlitski 2015-09-22 08:26:59 UTC
Review of attachment 311804 [details] [review]:

Makes sense to me.

Thanks for adding this so quickly!
Comment 3 Allison Karlitskaya (desrt) 2015-09-29 14:17:55 UTC
Attachment 311804 [details] pushed as 56b164a - g_variant_get_child(): flatten-first logic on '&'