summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2018-08-21 13:54:52 -0300
committerGeorge Marques <george@gmarqu.es>2018-08-21 13:54:52 -0300
commitfdf18a41985701aafb20d2f6d35f481fee22e6cc (patch)
tree1bc562c4158d9c904458466a4e175b4ffe3990aa /modules
parentabbdb9d9514ff1299a3a7cec044eaf735273cad3 (diff)
GDScript: Fix undefined behavior on GDScriptTokenizerBuffer
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_tokenizer.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_tokenizer.h b/modules/gdscript/gdscript_tokenizer.h
index 28a08bfaf8..11a291cb2e 100644
--- a/modules/gdscript/gdscript_tokenizer.h
+++ b/modules/gdscript/gdscript_tokenizer.h
@@ -283,8 +283,14 @@ public:
virtual String get_token_error(int p_offset = 0) const;
virtual void advance(int p_amount = 1);
#ifdef DEBUG_ENABLED
- virtual const Vector<Pair<int, String> > &get_warning_skips() const { return Vector<Pair<int, String> >(); }
- virtual const Set<String> &get_warning_global_skips() const { return Set<String>(); }
+ virtual const Vector<Pair<int, String> > &get_warning_skips() const {
+ static Vector<Pair<int, String> > v;
+ return v;
+ }
+ virtual const Set<String> &get_warning_global_skips() const {
+ static Set<String> s;
+ return s;
+ }
virtual const bool is_ignoring_warnings() const { return true; }
#endif // DEBUG_ENABLED
GDScriptTokenizerBuffer();