]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GIR writer: Fix crash on struct creation methods
authorLuca Bruno <lethalman88@gmail.com>
Mon, 14 Jun 2010 21:23:25 +0000 (23:23 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 16 Jun 2010 19:01:05 +0000 (21:01 +0200)
Fixes bug 621495.

codegen/valagirwriter.vala

index 33fd77e0c8b7164433cd8fb99c27e9d535ab827d..be1daa4d4b64e12bda7b3ca7071e9d746edbb0bb 100644 (file)
@@ -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 ());