diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 4c11e1ba8..2d7fe8250 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -834,11 +834,9 @@ void CheckBufferOverrun::valueFlowCheckArrayIndex(const Token * const tok, const void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo) { + assert(tok->previous() != nullptr); const MathLib::bigint total_size = arrayInfo.num(0) * arrayInfo.element_size(); - const Token *scope_begin = tok->previous(); - assert(scope_begin != 0); - const unsigned int declarationId = arrayInfo.declarationId(); const bool isPortabilityEnabled = _settings->isEnabled("portability");