[vala/0.10] codegen: Fix uninitialized variable in constructors throwing errors
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.10] codegen: Fix uninitialized variable in constructors throwing errors
- Date: Fri, 8 Oct 2010 21:18:32 +0000 (UTC)
commit 80d54c76808a04f9ea16fc0c186710372a23122e
Author: Jürg Billeter <j bitron ch>
Date: Fri Oct 8 20:23:21 2010 +0200
codegen: Fix uninitialized variable in constructors throwing errors
codegen/valaccodemethodmodule.vala | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 4232ab4..6fa7ea8 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -529,14 +529,14 @@ public class Vala.CCodeMethodModule : CCodeStructModule {
add_object_creation (cinit, current_class.get_type_parameters ().size > 0);
} else {
var cdeclaration = new CCodeDeclaration ("%s *".printf (((Class) current_type_symbol).get_cname ()));
- cdeclaration.add_declarator (new CCodeVariableDeclarator ("self"));
+ cdeclaration.add_declarator (new CCodeVariableDeclarator.zero ("self", new CCodeConstant ("NULL")));
cinit.append (cdeclaration);
}
} else if (is_gtypeinstance_creation_method (m)) {
var cl = (Class) m.parent_symbol;
var cdeclaration = new CCodeDeclaration (cl.get_cname () + "*");
- var cdecl = new CCodeVariableDeclarator ("self");
+ var cdecl = new CCodeVariableDeclarator.zero ("self", new CCodeConstant ("NULL"));
cdeclaration.add_declarator (cdecl);
cinit.append (cdeclaration);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]