Skip to content

Fix #12600 FP returnDanglingLifetime with smart pointer member (regression)#6255

Closed
chrchr-github wants to merge 4 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix12600
Closed

Fix #12600 FP returnDanglingLifetime with smart pointer member (regression)#6255
chrchr-github wants to merge 4 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix12600

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

There is still a FP for

struct S {
  void *out;
};
void bar(S* s);
void foo() {
  S s[1][1];
  char arr[5];
  s[0][0].out = &arr;
  bar(s[0]);
  int len = strlen(arr);
}

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

@pfultz2 any comments?

@pfultz2
Copy link
Copy Markdown
Contributor

pfultz2 commented Apr 9, 2024

I'll take a look at this. I think the any_of below might need to be updated to find the borrowed type.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Closing in favor of #6260

@chrchr-github chrchr-github deleted the chr_Fix12600 branch April 10, 2024 08:32
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