diff options
author | Krzesimir Nowak <qdlacz@gmail.com> | 2012-07-04 22:44:02 +0200 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-07-06 10:35:11 -0400 |
commit | 25166e1ab675f2f61fcaa5cbf3ffb4f2cec1a6f6 (patch) | |
tree | 1427dd5186005b7a40e81acffb3cef2ba198f539 /giscanner/scannerparser.y | |
parent | 6c66616b51aa105fec9b6d963ef49221d54a66c3 (diff) | |
download | gobject-introspection-25166e1ab675f2f61fcaa5cbf3ffb4f2cec1a6f6.tar.gz |
giscanner: Fix pointer parsing.
They were parsed in wrong order resulting in having wrong pointer
being const. For example - g_settings_list_schemas return type is
normally 'const gchar *const *', but parsing result was
'const gchar ** const'.
This was unnoticed, because pointer constness information is rather
not used by gobject-introspection now.
https://bugzilla.gnome.org/show_bug.cgi?id=656445
Diffstat (limited to 'giscanner/scannerparser.y')
-rw-r--r-- | giscanner/scannerparser.y | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y index 65ac5946..48e3c132 100644 --- a/giscanner/scannerparser.y +++ b/giscanner/scannerparser.y @@ -1088,12 +1088,24 @@ pointer } | '*' type_qualifier_list pointer { - $$ = gi_source_pointer_new ($3); - $$->type_qualifier = $2; + GISourceType **base = &($3->base_type); + + while (*base != NULL) { + base = &((*base)->base_type); + } + *base = gi_source_pointer_new (NULL); + (*base)->type_qualifier = $2; + $$ = $3; } | '*' pointer { - $$ = gi_source_pointer_new ($2); + GISourceType **base = &($2->base_type); + + while (*base != NULL) { + base = &((*base)->base_type); + } + *base = gi_source_pointer_new (NULL); + $$ = $2; } ; |