File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2135,19 +2135,20 @@ struct LifetimeStore {
21352135 for (const ValueFlow::LifetimeToken& lt : ValueFlow::getLifetimeTokens (argtok, settings)) {
21362136 if (!settings.certainty .isEnabled (Certainty::inconclusive) && lt.inconclusive )
21372137 continue ;
2138+
2139+ const Variable* var = lt.token ->variable ();
2140+ if (!var || !var->isArgument ())
2141+ continue ;
2142+
21382143 ValueFlow::Value value;
21392144 value.valueType = ValueFlow::Value::ValueType::LIFETIME;
21402145 value.tokvalue = lt.token ;
21412146 value.capturetok = argtok;
21422147 value.errorPath = er;
21432148 value.lifetimeKind = type;
21442149 value.setInconclusive (inconclusive || lt.inconclusive );
2145- const Variable* var = lt.token ->variable ();
2146- if (var && var->isArgument ()) {
2147- value.lifetimeScope = ValueFlow::Value::LifetimeScope::Argument;
2148- } else {
2149- continue ;
2150- }
2150+ value.lifetimeScope = ValueFlow::Value::LifetimeScope::Argument;
2151+
21512152 // Don't add the value a second time
21522153 if (std::find (tok->values ().cbegin (), tok->values ().cend (), value) != tok->values ().cend ())
21532154 continue ;
You can’t perform that action at this time.
0 commit comments