]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Use set_delegate_target for null literals
authorJürg Billeter <j@bitron.ch>
Sat, 9 Oct 2010 16:29:20 +0000 (18:29 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 9 Oct 2010 16:29:35 +0000 (18:29 +0200)
codegen/valaccodebasemodule.vala

index 83123505a44f70519772746fd17029eafe6cff4d..6bf4ea63b509791d7a94e0684e72f0af638f452b 100644 (file)
@@ -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"));
                }
        }