Skip to content

Commit 1193f66

Browse files
Update astutils.cpp
1 parent 4617bc2 commit 1193f66

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/astutils.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,10 +775,11 @@ std::vector<ValueType> getParentValueTypes(const Token* tok, const Settings& set
775775
if (scope && scope->numConstructors == 0 && t->derivedFrom.empty() &&
776776
(t->isClassType() || t->isStructType()) && numberOfArguments(ftok) <= scope->varlist.size() &&
777777
!scope->varlist.empty()) {
778-
assert(argn < scope->varlist.size());
779-
auto it = std::next(scope->varlist.cbegin(), argn);
780-
if (it->valueType())
781-
return {*it->valueType()};
778+
if (argn < scope->varlist.size()) {
779+
auto it = std::next(scope->varlist.cbegin(), argn);
780+
if (it->valueType())
781+
return { *it->valueType() };
782+
}
782783
}
783784
}
784785
}

0 commit comments

Comments
 (0)