Skip to content

Commit b98d327

Browse files
Update checknullpointer.h
1 parent 8710deb commit b98d327

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/checknullpointer.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ class CPPCHECKLIB CheckNullPointer : public Check {
7272
* @param var variables that the function read / write.
7373
* @param library --library files data
7474
*/
75-
static void parseFunctionCall(const Token &tok,
76-
std::list<const Token *> &var,
75+
static std::list<const Token*> parseFunctionCall(const Token &tok,
7776
const Library &library, bool checkNullArg = true);
7877

7978
/** @brief This constructor is used when running checks. */
@@ -125,6 +124,10 @@ class CPPCHECKLIB CheckNullPointer : public Check {
125124
void arithmetic();
126125
void pointerArithmeticError(const Token* tok, const ValueFlow::Value *value, bool inconclusive);
127126
void redundantConditionWarning(const Token* tok, const ValueFlow::Value *value, const Token *condition, bool inconclusive);
127+
128+
bool diag(const Token* tok) { return !mDiag.emplace(tok).second; }
129+
130+
std::set<const Token*> mDiag;
128131
};
129132
/// @}
130133
//---------------------------------------------------------------------------

0 commit comments

Comments
 (0)