summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-12-16 23:46:55 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-12-16 23:46:55 -0300
commitfd4648c081afa565cb20c923c4e3c94d88e71e4f (patch)
treed1093a0764651c21048bf72a19ba2ce95c3653e1 /modules/gdscript
parent2dd302ff906285c5fdcb5f7bc822eb786870327a (diff)
-fixed crash reported by n-pigeon
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gd_editor.cpp2
-rw-r--r--modules/gdscript/gd_parser.cpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index 41caaa0ddd..09f193706c 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -1165,7 +1165,7 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl
const GDParser::ClassNode *clss=context._class;
- bool _static=context.function->_static;
+ bool _static=context.function && context.function->_static;
while(clss) {
GDCompletionContext c = context;
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index f727512ff5..f79f3ee44a 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -2757,6 +2757,9 @@ Error GDParser::parse_bytecode(const Vector<uint8_t> &p_bytecode,const String& p
completion_class=NULL;
completion_function=NULL;
completion_block=NULL;
+ current_block=NULL;
+ current_class=NULL;
+ current_function=NULL;
self_path=p_self_path;
GDTokenizerBuffer *tb = memnew( GDTokenizerBuffer );
@@ -2776,6 +2779,10 @@ Error GDParser::parse(const String& p_code, const String& p_base_path, bool p_ju
completion_class=NULL;
completion_function=NULL;
completion_block=NULL;
+ current_block=NULL;
+ current_class=NULL;
+
+ current_function=NULL;
self_path=p_self_path;
GDTokenizerText *tt = memnew( GDTokenizerText );
@@ -2811,6 +2818,10 @@ void GDParser::clear() {
completion_class=NULL;
completion_function=NULL;
completion_block=NULL;
+ current_block=NULL;
+ current_class=NULL;
+
+ current_function=NULL;
validating=false;
error_set=false;