forked from qt-creator/qt-creator
ClangToolRunner: Ensure the clang tool is executable file
Just checking that it's not empty is not enough. Change-Id: I635c975d72a8c00983aa1f748c169b2d8f6e05f1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -133,7 +133,8 @@ static QString createOutputFilePath(const FilePath &dirPath, const QString &file
|
||||
|
||||
bool ClangToolRunner::run()
|
||||
{
|
||||
QTC_ASSERT(!m_executable.isEmpty(), return false);
|
||||
QTC_ASSERT(m_executable.isExecutableFile(),
|
||||
qWarning() << "Can't start:" << m_executable << "as" << m_name; return false);
|
||||
QTC_CHECK(!m_input.unit.arguments.contains(QLatin1String("-o")));
|
||||
QTC_CHECK(!m_input.unit.arguments.contains(m_input.unit.file));
|
||||
QTC_ASSERT(FilePath::fromString(m_input.unit.file).exists(), return false);
|
||||
|
@@ -203,7 +203,7 @@ void DocumentClangToolRunner::run()
|
||||
const FilePath executable = toolExecutable(tool);
|
||||
const auto [includeDir, clangVersion]
|
||||
= getClangIncludeDirAndVersion(executable);
|
||||
if (executable.isEmpty() || includeDir.isEmpty() || clangVersion.isEmpty())
|
||||
if (!executable.isExecutableFile() || includeDir.isEmpty() || clangVersion.isEmpty())
|
||||
return;
|
||||
const AnalyzeUnit unit(m_fileInfo, includeDir, clangVersion);
|
||||
m_runnerCreators << [this, tool, unit, config, env] {
|
||||
|
Reference in New Issue
Block a user