diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-01-13 13:05:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-13 13:05:39 +0100 |
commit | 854a7bd9bb7c665c977ce8fab7d43a26dbfe7c53 (patch) | |
tree | 8616d59afb2db8caca6496e77989bfa530d33922 /modules/gdscript | |
parent | 33be750634cffe577df4c97963124f27e65e6549 (diff) | |
parent | d5e1890c85374dd6637d211f1f6f5d9c1b9f3686 (diff) |
Merge pull request #35074 from GodotExplorer/lsp-fix-34147
Fix infinite loop error in document link parsing of GDScript Language Server
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/language_server/gdscript_extend_parser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp index c8ff471401..2d4344e6f3 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.cpp +++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp @@ -112,9 +112,10 @@ void ExtendGDScriptParser::update_document_links(const String &p_code) { FileAccessRef fs = FileAccess::create(FileAccess::ACCESS_RESOURCES); tokenizer.set_code(p_code); while (true) { - if (tokenizer.get_token() == GDScriptTokenizer::TK_EOF) { + GDScriptTokenizerText::Token token = tokenizer.get_token(); + if (token == GDScriptTokenizer::TK_EOF || token == GDScriptTokenizer::TK_ERROR) { break; - } else if (tokenizer.get_token() == GDScriptTokenizer::TK_CONSTANT) { + } else if (token == GDScriptTokenizer::TK_CONSTANT) { const Variant &const_val = tokenizer.get_token_constant(); if (const_val.get_type() == Variant::STRING) { String path = const_val; |