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 <thiago.macieira@intel.com>
(cherry picked from commit ad7ad62d17b337671f97fd342148edcff74acaa5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2023-01-03 18:49:09 +01:00 committed by Qt Cherry-pick Bot
parent fc43973114
commit 1ee479c66d

View File

@ -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 =