[vala] codegen: Add assertions to detect missing delegate target values
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Add assertions to detect missing delegate target values
- Date: Thu, 21 Oct 2010 19:31:30 +0000 (UTC)
commit c9496bee38fb9944d6c792f5af321426d5153ef7
Author: Jürg Billeter <j bitron ch>
Date: Thu Oct 21 21:28:07 2010 +0200
codegen: Add assertions to detect missing delegate target values
codegen/valaccodemethodcallmodule.vala | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index deef7a5..6c1d6e0 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -358,6 +358,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
if (d.has_target) {
CCodeExpression delegate_target_destroy_notify;
var delegate_target = get_delegate_target_cexpression (arg, out delegate_target_destroy_notify);
+ assert (delegate_target != null);
if (param.ctype == "GClosure*") {
// one single GClosure parameter
var closure_new = new CCodeFunctionCall (new CCodeIdentifier ("g_cclosure_new"));
@@ -368,6 +369,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
} else {
carg_map.set (get_param_pos (param.cdelegate_target_parameter_position), delegate_target);
if (deleg_type.value_owned) {
+ assert (delegate_target_destroy_notify != null);
carg_map.set (get_param_pos (param.cdelegate_target_parameter_position + 0.01), delegate_target_destroy_notify);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]