We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c39c213 commit aa0171dCopy full SHA for aa0171d
opencl/opencl-aot/source/utils.cpp
@@ -405,7 +405,10 @@ readBinaryFile(std::string FileName) {
405
406
bool isFileEndsWithGivenExtentionName(const std::string &FileName,
407
const char *Ext) {
408
- return FileName.substr(FileName.find_last_of('.')) == Ext;
+ std::size_t LastCharPosition = FileName.find_last_of('.');
409
+ if (LastCharPosition == std::string::npos)
410
+ return false;
411
+ return FileName.substr(LastCharPosition) == Ext;
412
}
413
414
bool isFileStartsWithGivenMagicNumber(const std::vector<char> &BinaryData,
0 commit comments