]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Accessor of interface-property might be absent
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 11 Mar 2017 09:34:34 +0000 (10:34 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 11 Mar 2017 09:34:34 +0000 (10:34 +0100)
Avoid criticals while unconditionaly trying to chain-up to non-existing
property-accessors without checking for null.

codegen/valagtypemodule.vala

index ab89c5e11e5fcbeea2bca52f228d9e0e74617770..86a6474a176c18a9196c49295c3c54480620182a 100644 (file)
@@ -1462,7 +1462,7 @@ public class Vala.GTypeModule : GErrorModule {
 
                                var ciface = new CCodeIdentifier ("iface");
 
-                               if (base_property.get_accessor != null) {
+                               if (base_property.get_accessor != null && prop.get_accessor != null) {
                                        generate_property_accessor_declaration (base_property.get_accessor, cfile);
 
                                        string cname = get_ccode_name (base_property.get_accessor);
@@ -1470,7 +1470,7 @@ public class Vala.GTypeModule : GErrorModule {
                                        cfunc = cast_property_accessor_pointer (prop.get_accessor, cfunc, iface);
                                        ccode.add_assignment (new CCodeMemberAccess.pointer (ciface, "get_%s".printf (prop.name)), cfunc);
                                }
-                               if (base_property.set_accessor != null) {
+                               if (base_property.set_accessor != null && prop.set_accessor != null) {
                                        generate_property_accessor_declaration (base_property.set_accessor, cfile);
 
                                        string cname = get_ccode_name (base_property.set_accessor);