소스 검색

Merge pull request #32591 from HaSa1002/lsp-fatal-crash

fix #32588 out of range crash in language server
Rémi Verschelde 5 년 전
부모
커밋
e49b40a974
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      modules/gdscript/language_server/gdscript_extend_parser.cpp

+ 1 - 1
modules/gdscript/language_server/gdscript_extend_parser.cpp

@@ -298,7 +298,7 @@ void ExtendGDScriptParser::parse_function_symbol(const GDScriptParser::FunctionN
 	const int line = LINE_NUMBER_TO_INDEX(p_func->line);
 	const int line = LINE_NUMBER_TO_INDEX(p_func->line);
 	r_symbol.range.start.line = line;
 	r_symbol.range.start.line = line;
 	r_symbol.range.start.character = p_func->column;
 	r_symbol.range.start.character = p_func->column;
-	r_symbol.range.end.line = MAX(p_func->body->end_line - 2, p_func->body->line);
+	r_symbol.range.end.line = MAX(p_func->body->end_line - 2, r_symbol.range.start.line);
 	r_symbol.range.end.character = lines[r_symbol.range.end.line].length();
 	r_symbol.range.end.character = lines[r_symbol.range.end.line].length();
 	r_symbol.selectionRange.start.line = r_symbol.range.start.line;
 	r_symbol.selectionRange.start.line = r_symbol.range.start.line;
 	r_symbol.documentation = parse_documentation(line);
 	r_symbol.documentation = parse_documentation(line);