From c0bedb5036c4b18e49fd55caff0515d3e276c814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 19 Dec 2010 21:27:28 +0100 Subject: [PATCH] Fixed #2331 (Token::Match is called with varid 0) --- lib/checknullpointer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 88a6d8a29..6b2d0be39 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -318,6 +318,8 @@ void CheckNullPointer::nullPointerStructByDeRefAndChec() // Is the function return value taken by the pointer? bool assignment = false; const unsigned int varid1(tok1->varId()); + if (varid1 == 0) + continue; const Token *tok2 = tok1->previous(); while (tok2 && !Token::Match(tok2, "[;{}]")) {