From bf2379128b836cefc2b23c0387e0175431fe1b37 Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Sun, 16 Jul 2023 12:06:18 +0200 Subject: [PATCH] Fix scope, value --- lib/valueflow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 3548bf6061d..ff79937f418 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -5631,7 +5631,7 @@ static void valueFlowForwardConst(Token* start, if (scope->type == Scope::ScopeType::eIf) { MathLib::bigint result{}; bool error{}; - execute(tok->scope()->bodyStart->linkAt(-1)->astOperand2(), pm, &result, &error, settings); + execute(scope->bodyStart->linkAt(-1)->astOperand2(), pm, &result, &error, settings); if (!result && !error) { setValue = false; break; @@ -5652,7 +5652,7 @@ static void valueFlowForwardConst(Token* start, ValueFlow::Value v{ value }; if (refs.size() > 1) v.setInconclusive(); - v.errorPath.insert(value.errorPath.end(), it->errors.cbegin(), it->errors.cend()); + v.errorPath.insert(v.errorPath.end(), it->errors.cbegin(), it->errors.cend()); setTokenValue(tok, std::move(v), settings); return; }