| 1979 | } |
| 1980 | |
| 1981 | const Library::Container * getLibraryContainer(const Token * tok) |
| 1982 | { |
| 1983 | if (!tok) |
| 1984 | return nullptr; |
| 1985 | // TODO: Support dereferencing iterators |
| 1986 | // TODO: Support dereferencing with -> |
| 1987 | if (tok->isUnaryOp("*") && astIsPointer(tok->astOperand1())) { |
| 1988 | for (const ValueFlow::Value& v:tok->astOperand1()->values()) { |
| 1989 | if (!v.isLocalLifetimeValue()) |
| 1990 | continue; |
| 1991 | if (v.lifetimeKind != ValueFlow::Value::LifetimeKind::Address) |
| 1992 | continue; |
| 1993 | return getLibraryContainer(v.tokvalue); |
| 1994 | } |
| 1995 | } |
| 1996 | if (!tok->valueType()) |
| 1997 | return nullptr; |
| 1998 | return tok->valueType()->container; |
| 1999 | } |
| 2000 | |
| 2001 | Library::TypeCheck Library::getTypeCheck(std::string check, std::string typeName) const |
| 2002 | { |
no test coverage detected