Skip to content

Commit cfe401c

Browse files
committed
maybe fix #14126 squash maybe
1 parent 381d5d3 commit cfe401c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/tokenize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9542,14 +9542,14 @@ void Tokenizer::simplifyCPPAttribute()
95429542
Token* head = skipCPPOrAlignAttribute(tok)->next();
95439543
while (isCPPAttribute(head) || isAlignAttribute(head))
95449544
head = skipCPPOrAlignAttribute(head)->next();
9545-
while (Token::Match(head->next(), "%name%|*|&|&&|const|static|inline|volatile"))
9545+
while (head && Token::Match(head->next(), "%name%|*|&|&&|const|static|inline|volatile"))
95469546
head = head->next();
95479547
if (Token::Match(head, "%name%") && !Token::Match(head, "auto ["))
95489548
head->isAttributeMaybeUnused(true);
95499549
else if (Token::Match(tok->previous(), "%name%") && Token::Match(tok->link(), "] [;={]")) {
95509550
tok->previous()->isAttributeMaybeUnused(true);
95519551
} else {
9552-
if (Token::simpleMatch(head->next(), "[")) {
9552+
if (head && Token::simpleMatch(head->next(), "[")) {
95539553
head = head->next();
95549554
const Token *end = head->link();
95559555
for (head = head->next(); end && head != end; head = head->next()) {

0 commit comments

Comments
 (0)