[vala] codegen: Fix crash on delegates with varargs



commit 30c79055924a153304d4d691b8f508cd7a2ce823
Author: Jürg Billeter <j bitron ch>
Date:   Tue Oct 26 21:20:47 2010 +0200

    codegen: Fix crash on delegates with varargs

 codegen/valaccodemethodcallmodule.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index 6c1d6e0..0083b63 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -593,10 +593,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) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]