]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Add null check for non-null struct parameters
authorLuca Bruno <lucabru@src.gnome.org>
Wed, 17 Aug 2011 15:13:57 +0000 (17:13 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Wed, 17 Aug 2011 15:18:36 +0000 (17:18 +0200)
Commit 94d4b1e91a437f739b42f fixes another relevant part of the bug.

Fixes bug 656693.

codegen/valaccodemethodmodule.vala

index 9d8a802061f85abd7ffdd7027bcd30011189b2ce..c471ed73f0339750f0ac90dbcefc1da40d58ece7 100644 (file)
@@ -446,7 +446,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
 
                                        if (param.direction != ParameterDirection.OUT) {
                                                var t = param.variable_type.data_type;
-                                               if (t != null && t.is_reference_type ()) {
+                                               if (t != null && (t.is_reference_type () || param.variable_type.is_real_struct_type ())) {
                                                        create_method_type_check_statement (m, creturn_type, t, !param.variable_type.nullable, get_variable_cname (param.name));
                                                }
                                        } else if (!m.coroutine) {