Skip to content

Commit 6ad6ce5

Browse files
Update vf_analyzers.cpp
1 parent 6c11344 commit 6ad6ce5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/vf_analyzers.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,12 @@ struct ContainerExpressionAnalyzer : ExpressionAnalyzer {
14891489
const Library::Container::Action action = container->getAction(tok->astParent()->strAt(1));
14901490
if (action == Library::Container::Action::PUSH || action == Library::Container::Action::POP || action == Library::Container::Action::APPEND) { // TODO: handle more actions?
14911491
std::vector<const Token*> args = getArguments(tok->tokAt(3));
1492-
if (args.size() < 2 || action == Library::Container::Action::APPEND)
1492+
bool isVariadic = false;
1493+
if (const Library::Function* libFunc = settings.library.getFunction(tok->tokAt(2)); {
1494+
const auto& argChecks = libFunc->argumentChecks;
1495+
isVariadic = argChecks.find(-1) != argChecks.end() && argChecks.at(-1).variadic;
1496+
}
1497+
if (args.size() < 2 || action == Library::Container::Action::APPEND || isVariadic)
14931498
return Action::Read | Action::Write | Action::Incremental;
14941499
}
14951500
}

0 commit comments

Comments
 (0)