null pointer: use simplified token list in the 'check and deref' checking

This commit is contained in:
Daniel Marjamäki 2010-10-25 21:05:43 +02:00
parent 132aa8d0c4
commit bdd6d6d53d
3 changed files with 10 additions and 8 deletions

View File

@ -2604,7 +2604,6 @@ void CheckOther::nullPointer()
nullPointerLinkedList(); nullPointerLinkedList();
nullPointerStructByDeRefAndChec(); nullPointerStructByDeRefAndChec();
nullPointerByDeRefAndChec(); nullPointerByDeRefAndChec();
nullPointerByCheckAndDeRef();
} }
/** Derefencing null constant (simplified token list) */ /** Derefencing null constant (simplified token list) */

View File

@ -91,7 +91,7 @@ public:
checkOther.checkMisusedScopedObject(); checkOther.checkMisusedScopedObject();
// FIXME: I get a deadlock if I uncomment this: // FIXME: I get a deadlock if I uncomment this:
//nullPointerByCheckAndDeRef(); checkOther.nullPointerByCheckAndDeRef();
} }
@ -147,6 +147,12 @@ public:
/** @brief possible null pointer dereference */ /** @brief possible null pointer dereference */
void nullPointer(); void nullPointer();
/**
* @brief Does one part of the check for nullPointer().
* Checking if pointer is NULL and then dereferencing it..
*/
void nullPointerByCheckAndDeRef();
/** @brief dereferencing null constant (after Tokenizer::simplifyKnownVariables) */ /** @brief dereferencing null constant (after Tokenizer::simplifyKnownVariables) */
void nullConstantDereference(); void nullConstantDereference();
@ -327,12 +333,6 @@ private:
*/ */
void nullPointerByDeRefAndChec(); void nullPointerByDeRefAndChec();
/**
* @brief Does one part of the check for nullPointer().
* Checking if pointer is NULL and then dereferencing it..
*/
void nullPointerByCheckAndDeRef();
/** /**
* @brief Does one part of the check for nullPointer(). * @brief Does one part of the check for nullPointer().
* -# initialize pointer to 0 * -# initialize pointer to 0

View File

@ -613,6 +613,9 @@ private:
tokenizer.simplifyTokenList(); tokenizer.simplifyTokenList();
checkOther.nullConstantDereference(); checkOther.nullConstantDereference();
checkOther.executionPaths(); checkOther.executionPaths();
tokenizer.simplifyTokenList();
checkOther.nullPointerByCheckAndDeRef();
} }