From 6b9088de3f1a2060fa237115d335b7e9f81d6bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 19 Oct 2015 19:36:46 +0200 Subject: [PATCH] Fixed #7057 (valueFlowAfterAssign doesn't terminate) --- lib/valueflow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index be62070e9..da40345db 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -363,6 +363,11 @@ static bool addValue(Token *tok, const ValueFlow::Value &value) tok->values.clear(); } + // Don't handle more than 10 values for performance reasons + // TODO: add setting? + if (tok->values.size() >= 10U) + return false; + // if value already exists, don't add it again std::list::iterator it; for (it = tok->values.begin(); it != tok->values.end(); ++it) {