[gobject-introspection] giscanner: Fix pointer parsing.



commit 25166e1ab675f2f61fcaa5cbf3ffb4f2cec1a6f6
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Wed Jul 4 22:44:02 2012 +0200

    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

 giscanner/scannerparser.y |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y
index 65ac594..48e3c13 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;
 	  }
 	;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]