From 37d4a01dcba227d19633eb7746ad00b8351f0097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 8 Oct 2011 07:39:20 +0200 Subject: [PATCH] Added todo comments to fix false negatives caused by my fix for #3128 --- lib/checknullpointer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index f3cf18706..4ee49180c 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -370,6 +370,9 @@ void CheckNullPointer::nullPointerStructByDeRefAndChec() else if (Token::Match(tok1, "( ! %var% ||") || Token::Match(tok1, "( %var% &&")) { + // TODO: there are false negatives caused by this. The + // variable should be removed from skipvar after the + // condition tok1 = tok1->next(); if (tok1->str() == "!") tok1 = tok1->next(); @@ -573,6 +576,9 @@ void CheckNullPointer::nullPointerByDeRefAndChec() if (Token::Match(tok1->link()->previous(), "while ( %varid%", varid)) break; + // TODO: there might be false negatives. perhaps + // instead of bailing out it's ok to skip the condition. + // this bailout is related to #3128 if (Token::Match(tok1->link(), "( ! %varid% ||", varid) || Token::Match(tok1->link(), "( %varid% &&", varid)) break;