From 76510e00067f492f32e7f668bbe11b82e75052eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 16 Aug 2014 12:48:20 +0200 Subject: [PATCH] null pointer: perform proper null pointer checking when no --enable=warning is given. --- lib/checknullpointer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 1f0e61289..7849404d1 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -382,11 +382,8 @@ void CheckNullPointer::nullPointerByDeRefAndChec() void CheckNullPointer::nullPointer() { nullPointerLinkedList(); - - if (_settings->isEnabled("warning")) { - nullPointerByDeRefAndChec(); - nullPointerDefaultArgument(); - } + nullPointerByDeRefAndChec(); + nullPointerDefaultArgument(); } /** Dereferencing null constant (simplified token list) */ @@ -501,6 +498,9 @@ void CheckNullPointer::removeAssignedVarFromSet(const Token* tok, std::setisEnabled("warning")) + return; + const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase(); const std::size_t functions = symbolDatabase->functionScopes.size(); for (std::size_t i = 0; i < functions; ++i) {