]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix crash on delegates with varargs
authorJürg Billeter <j@bitron.ch>
Tue, 26 Oct 2010 19:20:47 +0000 (21:20 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 29 Oct 2010 16:50:22 +0000 (18:50 +0200)
codegen/valaccodemethodcallmodule.vala

index ad262fa9f72ad54a69c832c166c7e68d8fa5e470..5fc56c21acf03c282f83ae0768d9782a663dee7e 100644 (file)
@@ -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) {