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.

Pick-to: 6.5
Fixes: QTBUG-109790
Change-Id: I5f77893462d397f6738a5da1af6ed8dd8a2df70a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Alexey Edelev 2023-01-03 18:49:09 +01:00
parent fb8701cb8b
commit ad7ad62d17
1 changed files with 6 additions and 2 deletions

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 =