From 1ee479c66d8d2572e514bd60946b30911242d217 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Tue, 3 Jan 2023 18:49:09 +0100 Subject: [PATCH] Avoid breaking version script generator state Pass every line to parseVersionScriptContent to not break the version script generator state. The parser doesn't collect characters from comment block, so the line containing the 'ignore-next' ELFVERSION tag produces empty buffer for the further parsing process. Call the parseVersionScriptContent function even on empty buffers to make sure that 'ignore-next' counts lines correcly. Fixes: QTBUG-109790 Change-Id: I5f77893462d397f6738a5da1af6ed8dd8a2df70a Reviewed-by: Thiago Macieira (cherry picked from commit ad7ad62d17b337671f97fd342148edcff74acaa5) Reviewed-by: Qt Cherry-pick Bot --- src/tools/syncqt/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tools/syncqt/main.cpp b/src/tools/syncqt/main.cpp index 4567f7c4ad6..4a82f9b64ca 100644 --- a/src/tools/syncqt/main.cpp +++ b/src/tools/syncqt/main.cpp @@ -882,6 +882,9 @@ public: break; } + if (buffer.empty()) + return; + std::smatch match; std::string symbol; if (std::regex_match(buffer, match, VersionScriptSymbolRegex) && match[2].str().empty()) @@ -1103,14 +1106,15 @@ public: } line.clear(); - if (buffer.empty()) - continue; scannerDebug() << m_currentFilename << ": " << buffer << std::endl; if (m_currentFileType & PrivateHeader) { parseVersionScriptContent(buffer, result); } + if (buffer.empty()) + continue; + ++linesProcessed; bool skipSymbols =