fix: avoid dereferencing nullptr

Related-To: NEO-11825

Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
Maciej Bielski 2024-06-26 13:44:42 +00:00 committed by Compute-Runtime-Automation
parent 116c3ef771
commit c80a5e0143
1 changed files with 12 additions and 9 deletions

View File

@ -423,11 +423,14 @@ int OfflineCompiler::queryAcronymIds(size_t numArgs, const std::vector<std::stri
}
}
} else {
auto hwInfoDepAcr = getHwInfoForDeprecatedAcronym(queryAcronym);
if (nullptr != hwInfoDepAcr) {
auto compilerProductHelper = NEO::CompilerProductHelper::create(hwInfoDepAcr->platform.eProductFamily);
matchedVersions.push_back(ProductConfigHelper::parseMajorMinorRevisionValue(compilerProductHelper->getDefaultHwIpVersion()));
} else {
bool isMatched{false};
if (auto hwInfoDepAcr = getHwInfoForDeprecatedAcronym(queryAcronym); hwInfoDepAcr) {
if (auto compilerProductHelper = NEO::CompilerProductHelper::create(hwInfoDepAcr->platform.eProductFamily); compilerProductHelper) {
matchedVersions.push_back(ProductConfigHelper::parseMajorMinorRevisionValue(compilerProductHelper->getDefaultHwIpVersion()));
isMatched = true;
}
}
if (!isMatched) {
helper->printf("Error: Invalid command line. Unknown acronym %s.\n", allArgs[2].c_str());
retVal = OCLOC_INVALID_COMMAND_LINE;
return retVal;