Skip to content

Fix #11393 FP danglingLifetime with pointer to pointer#7226

Merged
chrchr-github merged 2 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_11393
Jan 15, 2025
Merged

Fix #11393 FP danglingLifetime with pointer to pointer#7226
chrchr-github merged 2 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_11393

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@chrchr-github chrchr-github merged commit 1cce204 into cppcheck-opensource:main Jan 15, 2025
@chrchr-github chrchr-github deleted the chr_11393 branch January 15, 2025 20:57
if (var && !var->isLocal() && !var->isArgument() && !(val.tokvalue && val.tokvalue->variable() && val.tokvalue->variable()->isStatic()) &&
!isVariableChanged(nextTok,
tok->scope()->bodyEnd,
var->valueType() ? var->valueType()->pointer : 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I recall the pointer value is different than the indirect value.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Then how do we get the correct value here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the pointer a bitset that sets each level indirection? Or is that just const?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

///< 0=>not pointer, 1=>*, 2=>**, 3=>***, etc
constness and volatileness are bitsets.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry I was confused.

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