From 63d1bbae78d01c9e2142e8617c78b4e93d91938d Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 20 Jan 2023 05:05:54 +0100 Subject: [PATCH] Fix v8.4.8 hanging while opening some Pascal files Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12822#issuecomment-1397862706 Fix #12822 --- PowerEditor/src/WinControls/FunctionList/functionParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp index bd88cc16a..078ddeb4d 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp @@ -388,15 +388,15 @@ void FunctionParser::funcParse(std::vector & foundInfos, size_t begin int flags = SCFIND_REGEXP | SCFIND_POSIX | SCFIND_REGEXP_DOTMATCHESNL; (*ppEditView)->execute(SCI_SETSEARCHFLAGS, flags); - size_t targetStart = (*ppEditView)->searchInTarget(_functionExpr.c_str(), _functionExpr.length(), begin, end); - size_t targetEnd = 0; + intptr_t targetStart = (*ppEditView)->searchInTarget(_functionExpr.c_str(), _functionExpr.length(), begin, end); + intptr_t targetEnd = 0; //foundInfos.clear(); while (targetStart >= 0) { targetStart = (*ppEditView)->execute(SCI_GETTARGETSTART); targetEnd = (*ppEditView)->execute(SCI_GETTARGETEND); - if (targetEnd > end) //we found a result but outside our range, therefore do not process it + if (targetEnd > static_cast(end)) //we found a result but outside our range, therefore do not process it { break; }