Skip to content

Commit 6d5b102

Browse files
committed
refs #13698 - Library: avoid lookup of empty stings [skip ci]
1 parent f051f79 commit 6d5b102

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/library.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,8 @@ const Library::Container* Library::detectContainerInternal(const Token* const ty
13241324
{
13251325
if (!typeStart)
13261326
return nullptr;
1327+
if (typeStart->str().empty())
1328+
return nullptr;
13271329
const Token* firstLinkedTok = nullptr;
13281330
for (const Token* tok = typeStart; tok && !tok->varId(); tok = tok->next()) {
13291331
if (!tok->link())
@@ -1894,6 +1896,8 @@ const Library::SmartPointer* Library::detectSmartPointer(const Token* tok, bool
18941896
typestr += tok->str();
18951897
tok = tok->next();
18961898
}
1899+
if (typestr.empty())
1900+
return nullptr;
18971901
auto it = mData->mSmartPointers.find(typestr);
18981902
if (it == mData->mSmartPointers.end())
18991903
return nullptr;

0 commit comments

Comments
 (0)