]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gdbus: Don't pass null to get_ccode_array_length_type() to fix criticals
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 4 Nov 2018 09:00:01 +0000 (10:00 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 4 Nov 2018 09:01:16 +0000 (10:01 +0100)
codegen/valagdbusclientmodule.vala
codegen/valagdbusservermodule.vala

index a0f15b42b1b283aac64a8c106e74a3b20d5f801c..57051b2c482adf613e04e0863d098c1376aa59e8 100644 (file)
@@ -800,9 +800,8 @@ public class Vala.GDBusClientModule : GDBusModule {
                                                ccode.add_declaration (get_ccode_name (param.variable_type), new CCodeVariableDeclarator.zero ("_vala_%s".printf (param.name), default_value_for_type (param.variable_type, true)));
 
                                                var array_type = param.variable_type as ArrayType;
-                                               var length_ctype = get_ccode_array_length_type (array_type);
-
                                                if (array_type != null) {
+                                                       var length_ctype = get_ccode_array_length_type (array_type);
                                                        for (int dim = 1; dim <= array_type.rank; dim++) {
                                                                ccode.add_declaration (length_ctype, new CCodeVariableDeclarator ("_vala_%s_length%d".printf (param.name, dim), new CCodeConstant ("0")));
                                                        }
@@ -841,9 +840,8 @@ public class Vala.GDBusClientModule : GDBusModule {
                                                ccode.add_declaration (get_ccode_name (m.return_type), new CCodeVariableDeclarator.zero ("_result", default_value_for_type (m.return_type, true)));
 
                                                var array_type = m.return_type as ArrayType;
-                                               var length_ctype = get_ccode_array_length_type (array_type);
-
                                                if (array_type != null) {
+                                                       var length_ctype = get_ccode_array_length_type (array_type);
                                                        for (int dim = 1; dim <= array_type.rank; dim++) {
                                                                ccode.add_declaration (length_ctype, new CCodeVariableDeclarator ("_result_length%d".printf (dim), new CCodeConstant ("0")));
                                                        }
index c446ffd0e1927fbee615bcf276f898b663274bea..904e045023499aa6aa33b9c11f11701548b0e095 100644 (file)
@@ -149,8 +149,8 @@ public class Vala.GDBusServerModule : GDBusClientModule {
                                }
 
                                var array_type = param.variable_type as ArrayType;
-                               var length_ctype = get_ccode_array_length_type (array_type);
                                if (array_type != null) {
+                                       var length_ctype = get_ccode_array_length_type (array_type);
                                        for (int dim = 1; dim <= array_type.rank; dim++) {
                                                string length_cname = get_parameter_array_length_cname (param, dim);