From 821351be0420c4b3def6b83c287ee7463e6e3506 Mon Sep 17 00:00:00 2001 From: Zher Huei Lee Date: Wed, 30 Dec 2015 00:23:26 +0000 Subject: [PATCH 1/2] added missing onready allocation for subclasses Fixes #3158 --- modules/gdscript/gd_parser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 912170d2b00..64b7f26e92e 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -2081,6 +2081,8 @@ void GDParser::_parse_class(ClassNode *p_class) { ClassNode *newclass = alloc_node(); newclass->initializer = alloc_node(); newclass->initializer->parent_class=newclass; + newclass->ready = alloc_node(); + newclass->ready->parent_class=newclass; newclass->name=name; newclass->owner=p_class; From 61a1f596cc19fd47ff1c8d1f5f5d7c4af300bc8f Mon Sep 17 00:00:00 2001 From: Zher Huei Lee Date: Wed, 30 Dec 2015 01:02:31 +0000 Subject: [PATCH 2/2] added missing null check for p_func inside _parse_function --- modules/gdscript/gd_compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index add6235f328..7b070105290 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -1218,7 +1218,7 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode * bool is_initializer=!p_for_ready && !p_func; - if (is_initializer || String(p_func->name)=="_init") { + if (is_initializer || (p_func && String(p_func->name)=="_init")) { //parse initializer for class members if (!p_func && p_class->extends_used && p_script->native.is_null()){