Skip to content

Fix #14535: false positive: unreadVariable (array access after pointer cast)#8324

Open
ludviggunne wants to merge 2 commits intodanmar:mainfrom
ludviggunne:14535
Open

Fix #14535: false positive: unreadVariable (array access after pointer cast)#8324
ludviggunne wants to merge 2 commits intodanmar:mainfrom
ludviggunne:14535

Conversation

@ludviggunne
Copy link
Collaborator

No description provided.

@sonarqubecloud
Copy link

globalData = true;
return ChildrenToVisit::none;
const Token *lhs = tok->astOperand1();
if (!lhs->variable() && Token::Match(lhs, "( %type%")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably better to check lhs->isCast() && !lhs->astOperand2(). That should also handle (::Type).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants