DanTheMan2000 · GitHub

@DanTheMan2000

Copy link Copy Markdown

Contributor

No description provided.

@DanTheMan2000

@DanTheMan2000

Copy link Copy Markdown

Contributor Author

There were actually two variants of this false positive. The one from the ticket involved reading another union member inside a larger expression. The other case is where an assignment to a different union member sits between the two writes to the member being reassigned. Added tests covering both in testother.cpp.

@DanTheMan2000

@DanTheMan2000

@DanTheMan2000

Copy link Copy Markdown

Contributor Author

Added a couple of control tests to go with the false-positive ones, wanted to make sure the fix is scoped to the actual variable being reassigned.

@chrchr-github

Copy link Copy Markdown

Collaborator

Thanks for your contribution.
As far as I see, the added tests all use the same union definition. Can you consolidate them into one test case containing multiple functions?

The separate #14371 tests all used the same union definition, so combine them into one test case containing multiple functions as requested in review.

@chrchr-github

Copy link Copy Markdown

Collaborator

If you wish, you can add yourself to the AUTHORS file. Please add [skip ci] in the commit message.

@DanTheMan2000

Copy link Copy Markdown

Contributor Author

If you wish, you can add yourself to the AUTHORS file. Please add [skip ci] in the commit message.

I don't think that's necessary. Thanks!

@chrchr-github

Read the original on github.com ↗