Skip to content

Commit 1dfd306

Browse files
Update valueflow.cpp
1 parent f3e2845 commit 1dfd306

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/valueflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,7 @@ static std::vector<ValueFlow::LifetimeToken> getLifetimeTokens(const Token* tok,
17961796
if (Token::Match(tok->tokAt(-2), ". %name% (") && tok->tokAt(-2)->originalName() != "->" && astIsContainer(tok->tokAt(-2)->astOperand1())) {
17971797
const Library::Container* library = getLibraryContainer(tok->tokAt(-2)->astOperand1());
17981798
const Library::Container::Yield y = library->getYield(tok->strAt(-1));
1799-
if (y == Library::Container::Yield::AT_INDEX || y == Library::Container::Yield::ITEM) {
1799+
if (y == Library::Container::Yield::AT_INDEX || y == Library::Container::Yield::ITEM || y == Library::Container::Yield::BUFFER || y == Library::Container::Yield::BUFFER_NT) {
18001800
errorPath.emplace_back(tok->previous(), "Accessing container.");
18011801
return ValueFlow::LifetimeToken::setAddressOf(
18021802
getLifetimeTokens(tok->tokAt(-2)->astOperand1(), escape, std::move(errorPath), pred, settings, depth - 1),

0 commit comments

Comments
 (0)