From: Jürg Billeter Date: Tue, 26 Oct 2010 19:20:47 +0000 (+0200) Subject: codegen: Fix crash on delegates with varargs X-Git-Tag: 0.10.2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f1d7ebef0c347237641c05035fc3aec68330459;p=thirdparty%2Fvala.git codegen: Fix crash on delegates with varargs --- diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala index ad262fa9f..5fc56c21a 100644 --- a/codegen/valaccodemethodcallmodule.vala +++ b/codegen/valaccodemethodcallmodule.vala @@ -652,10 +652,14 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { if (ellipsis) { /* ensure variable argument list ends with NULL * except when using printf-style arguments */ - if (!m.printf_format && !m.scanf_format && m.sentinel != "") { + if (m == null) { + in_arg_map.set (get_param_pos (-1, true), new CCodeConstant (Method.DEFAULT_SENTINEL)); + } else if (!m.printf_format && !m.scanf_format && m.sentinel != "") { in_arg_map.set (get_param_pos (-1, true), new CCodeConstant (m.sentinel)); } - } else if (itype is DelegateType) { + } + + if (itype is DelegateType) { var deleg_type = (DelegateType) itype; var d = deleg_type.delegate_symbol; if (d.has_target) {