From b063b0e86eb4b53e9126f700efa1e3f627a303a8 Mon Sep 17 00:00:00 2001 From: paxcut Date: Fri, 29 May 2026 07:21:21 -0700 Subject: [PATCH] fix: imhex uses all memory Om March 29 I merged a commit that was supposed to improve message of error when an invalid keyword was found inside a function. It did that, but it also created a possible infinite loop while writing a function. The problem was that the current token was not being moved forward when encountering the error which made ImHex use more and more memory until my computer froze. The fix is a simple next() to advance the token. --- lib/source/pl/core/parser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/source/pl/core/parser.cpp b/lib/source/pl/core/parser.cpp index 8ae50131..e57af5ca 100644 --- a/lib/source/pl/core/parser.cpp +++ b/lib/source/pl/core/parser.cpp @@ -972,6 +972,7 @@ namespace pl::core { statement = parseFunctionVariableDecl(true); } else if (m_curr[0].type == Token::Type::Keyword) { errorHere("Invalid {} found in function.", getFormattedToken(0)); + next(); return nullptr; } else { errorHere("Invalid function statement.");