File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1324,6 +1324,9 @@ const Library::Container* Library::detectContainerInternal(const Token* const ty
13241324{
13251325 if (!typeStart)
13261326 return nullptr ;
1327+ if (typeStart->tokType () != Token::Type::eType && typeStart->tokType () != Token::Type::eName) {
1328+ return nullptr ;
1329+ }
13271330 const Token* firstLinkedTok = nullptr ;
13281331 for (const Token* tok = typeStart; tok && !tok->varId (); tok = tok->next ()) {
13291332 if (!tok->link ())
@@ -1889,6 +1892,11 @@ bool Library::isSmartPointer(const Token* tok) const
18891892
18901893const Library::SmartPointer* Library::detectSmartPointer (const Token* tok, bool withoutStd) const
18911894{
1895+ if (tok->tokType () != Token::Type::eType && tok->tokType () != Token::Type::eName) {
1896+ return nullptr ;
1897+ }
1898+
1899+ // TODO: this is flawed and might result in lookups like "uint64_tflags_"
18921900 std::string typestr = withoutStd ? " std::" : " " ;
18931901 while (Token::Match (tok, " %name%|::" )) {
18941902 typestr += tok->str ();
You can’t perform that action at this time.
0 commit comments