[vala] codegen: Use set_delegate_target for null literals
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Use set_delegate_target for null literals
- Date: Sat, 9 Oct 2010 17:08:27 +0000 (UTC)
commit fc293ae466e5b031ee220320fe70a09723e5be67
Author: Jürg Billeter <j bitron ch>
Date: Sat Oct 9 18:29:20 2010 +0200
codegen: Use set_delegate_target for null literals
codegen/valaccodebasemodule.vala | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 8312350..6bf4ea6 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3547,10 +3547,13 @@ public class Vala.CCodeBaseModule : CodeGenerator {
set_cvalue (expr, new CCodeConstant ("NULL"));
var array_type = expr.target_type as ArrayType;
+ var delegate_type = expr.target_type as DelegateType;
if (array_type != null) {
for (int dim = 1; dim <= array_type.rank; dim++) {
append_array_size (expr, new CCodeConstant ("0"));
}
+ } else if (delegate_type != null && delegate_type.delegate_symbol.has_target) {
+ set_delegate_target (expr, new CCodeConstant ("NULL"));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]