summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Holejsovsky <pholejs@src.gnome.org>2010-12-21 16:21:02 +0100
committerPavel Holejsovsky <pholejs@src.gnome.org>2010-12-21 16:31:10 +0100
commite0d54af03a9de674af11fe7b4b58859e000c777e (patch)
treedd6b6956350775427e98039d99533e0b4dd4236d
parentb64c1e40f931cd56f4ab7d51c8f4c876ac0013ee (diff)
downloadgobject-introspection-e0d54af03a9de674af11fe7b4b58859e000c777e.tar.gz
scanner: avoid crash when annotation explicitly changes 'self' argument
-rw-r--r--giscanner/maintransformer.py2
-rw-r--r--tests/scanner/Annotation-1.0-expected.gir5
-rw-r--r--tests/scanner/annotation.c9
-rw-r--r--tests/scanner/annotation.h1
4 files changed, 16 insertions, 1 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 5a9530b3..bafff607 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -908,7 +908,7 @@ method or constructor of some type."""
# A quick hack here...in the future we should catch C signature/GI signature
# mismatches in a general way in finaltransformer
- if first.type.ctype.count('*') != 1:
+ if first.type.ctype is not None and first.type.ctype.count('*') != 1:
return False
# Here we check both the c_symbol_prefix and (if that fails),
diff --git a/tests/scanner/Annotation-1.0-expected.gir b/tests/scanner/Annotation-1.0-expected.gir
index 6ee00f76..29c8bd69 100644
--- a/tests/scanner/Annotation-1.0-expected.gir
+++ b/tests/scanner/Annotation-1.0-expected.gir
@@ -263,6 +263,11 @@ each string needs to be freed.</doc>
</type>
</return-value>
</method>
+ <method name="hidden_self" c:identifier="annotation_object_hidden_self">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ </method>
<method name="in" c:identifier="annotation_object_in">
<doc xml:whitespace="preserve">This is a test for in arguments</doc>
<return-value transfer-ownership="none">
diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c
index 4c25178c..f7046e89 100644
--- a/tests/scanner/annotation.c
+++ b/tests/scanner/annotation.c
@@ -614,6 +614,15 @@ annotation_object_watch_full (AnnotationObject *object,
}
/**
+ * annotation_object_hidden_self:
+ * @object: (type AnnotationObject): A #AnnotationObject
+ **/
+void
+annotation_object_hidden_self (gpointer object)
+{
+}
+
+/**
* annotation_init:
* @argc: (inout): The number of args.
* @argv: (inout) (array length=argc): The arguments.
diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index b58aa814..e4c5de63 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -127,6 +127,7 @@ void annotation_object_watch_full (AnnotationObject *object,
AnnotationForeachFunc func,
gpointer user_data,
GDestroyNotify destroy);
+void annotation_object_hidden_self (gpointer object);
void annotation_init (int *argc,
char ***argv);