From daea5e2d6c50b64065c49836b8fd2360ad806879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 29 Apr 2020 11:00:24 +0200 Subject: [PATCH] Bug hunting: Do not warn about 'Division by zero' when variable is uninitialized --- lib/exprengine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index df3ceee4d..7572bc223 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -1975,6 +1975,8 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, return; if (tok->hasKnownIntValue() && tok->getKnownIntValue() != 0) return; + if (value.isUninit()) + return; float f = getKnownFloatValue(tok, 0.0f); if (f > 0.0f || f < 0.0f) return;