From: Luca Bruno Date: Wed, 17 Aug 2011 15:13:57 +0000 (+0200) Subject: codegen: Add null check for non-null struct parameters X-Git-Tag: 0.13.3~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54516a7eade2864c81352fd2bc8a90837297b97d;p=thirdparty%2Fvala.git codegen: Add null check for non-null struct parameters Commit 94d4b1e91a437f739b42f fixes another relevant part of the bug. Fixes bug 656693. --- diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index 9d8a80206..c471ed73f 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -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) {