[CompileTool] Throw when provided plugin config is incorrect (#18143)

* [CompileTool] Throw when a plugin config is missing a space separator between key and value

* Use OPENVINO_ASSERT macro to check for the separator presence
This commit is contained in:
Maxim Kurin authored and GitHub committed 2023-06-22 00:39:56 +04:00
1 parent c970d576a3
commit 3276b8d657
1 file changed
+9 -6
+9 -6
View File
@@ -598,12 +598,15 @@ static std::map<std::string, std::string> parseConfigFile(char comment = '#') {
continue;
}
size_t spacePos = option.find(' ');
std::string key, value;
if (spacePos != std::string::npos) {
key = option.substr(0, spacePos);
value = option.substr(spacePos + 1);
config[key] = value;
}
OPENVINO_ASSERT(spacePos != std::string::npos,
"Failed to find a space separator in "
"provided plugin config option: " +
option);
std::string key = option.substr(0, spacePos);
std::string value = option.substr(spacePos + 1);
config[key] = value;
}
}
return config;