소스 검색

Merge pull request #52436 from daniel-mcclintock/fix-out-of-bounds-completion-crash

Fix crash during completion lookback
Max Hilbrunner 4 년 전
부모
커밋
06b4a48444
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      scene/gui/code_edit.cpp

+ 1 - 1
scene/gui/code_edit.cpp

@@ -2744,7 +2744,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() {
 		/* If we have a space, previous word might be a keyword. eg "func |". */
 	} else if (cofs > 0 && line[cofs - 1] == ' ') {
 		int ofs = cofs - 1;
-		while (ofs >= 0 && line[ofs] == ' ') {
+		while (ofs > 0 && line[ofs] == ' ') {
 			ofs--;
 		}
 		prev_is_word = _is_char(line[ofs]);