summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Bruno <lethalman88@gmail.com>2010-06-14 23:23:25 +0200
committerJürg Billeter <j@bitron.ch>2010-06-16 21:01:05 +0200
commit7b6b40f569fffbc6fd0d64cc671867b1f312f446 (patch)
treeff3eb549158a9ffced2e9cdb8b167975bc3a68b7
parent7631c005ed21609a04fec882271e8ae7f5ab1372 (diff)
downloadvala-7b6b40f569fffbc6fd0d64cc671867b1f312f446.tar.gz
GIR writer: Fix crash on struct creation methods
Fixes bug 621495.
-rw-r--r--codegen/valagirwriter.vala3
1 files changed, 2 insertions, 1 deletions
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 33fd77e0c..be1daa4d4 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -691,7 +691,8 @@ public class Vala.GIRWriter : CodeVisitor {
write_indent ();
- if (m == ((Class)m.parent_symbol).default_construction_method) {
+ if (m.parent_symbol is Class && m == ((Class)m.parent_symbol).default_construction_method ||
+ m.parent_symbol is Struct && m == ((Struct)m.parent_symbol).default_construction_method) {
buffer.append_printf ("<constructor name=\"new\" c:identifier=\"%s\"", m.get_cname ());
} else {
buffer.append_printf ("<constructor name=\"%s\" c:identifier=\"%s\"", m.name, m.get_cname ());