Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11393 FP danglingLifetime with pointer to pointer #7226

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

@chrchr-github chrchr-github merged commit 1cce204 into danmar:main Jan 15, 2025
60 checks passed
@chrchr-github chrchr-github deleted the chr_11393 branch January 15, 2025 20:57
@@ -648,6 +648,7 @@ void CheckAutoVariables::checkVarLifetimeScope(const Token * start, const Token
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
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
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
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
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
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