Skip to content

Commit d56945f

Browse files
fixup! fixup! Fix #11311 Do not search for null pointer in dead code
1 parent 9e7c76d commit d56945f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lib/checknullpointer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,13 @@ void CheckNullPointer::nullPointerByDeRefAndCheck()
320320
if (!printInconclusive && value->isInconclusive())
321321
return false;
322322

323+
if (isPointerUnevaluated(tok))
324+
return false;
325+
323326
return true;
324327
};
325328
std::vector<const Token *> tokens = findTokensSkipDeadCode(mSettings->library, scope->bodyStart, scope->bodyEnd, pred);
326329
for (const Token *tok : tokens) {
327-
if (isPointerUnevaluated(tok))
328-
continue;
329-
330330
const ValueFlow::Value *value = tok->getValue(0);
331331

332332
// Pointer dereference.

0 commit comments

Comments
 (0)