From 810b7e198ed5dd9be5505624f0bbae5c4ea6f35b Mon Sep 17 00:00:00 2001 From: Eddy Kim Date: Fri, 13 Jan 2023 22:48:01 +0900 Subject: [PATCH] Update calculateFileInfo for the null string case for 2022.3 (#15078) * updated not to find absPath for null filePath * changed to cache only std::runtime_error * fix clang-format error --- src/inference/src/compilation_context.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/inference/src/compilation_context.cpp b/src/inference/src/compilation_context.cpp index d23a09158b0..dea8437e8c9 100644 --- a/src/inference/src/compilation_context.cpp +++ b/src/inference/src/compilation_context.cpp @@ -46,10 +46,12 @@ static int32_t as_int32_t(T v) { std::string NetworkCompilationContext::calculateFileInfo(const std::string& filePath) { uint64_t seed = 0; auto absPath = filePath; - try { - absPath = FileUtils::absoluteFilePath(filePath); - } catch (...) { - // can't get absolute path, will use filePath for hash + if (filePath.size() > 0) { + try { + absPath = FileUtils::absoluteFilePath(filePath); + } catch (std::runtime_error&) { + // can't get absolute path, will use filePath for hash + } } seed = hash_combine(seed, absPath);