Skip to content

Fix issue 9302: FP uninitvar - struct accessed via pointer#2121

Merged
danmar merged 1 commit intocppcheck-opensource:masterfrom
pfultz2:uninitvar-9302
Aug 29, 2019
Merged

Fix issue 9302: FP uninitvar - struct accessed via pointer#2121
danmar merged 1 commit intocppcheck-opensource:masterfrom
pfultz2:uninitvar-9302

Conversation

@pfultz2
Copy link
Copy Markdown
Contributor

@pfultz2 pfultz2 commented Aug 28, 2019

No description provided.

Comment thread test/testuninitvar.cpp
" struct VZ vz;\n"
" struct VZ* pvz = &vz;\n"
" vz.typ = 42;\n"
" if (pvz->typ == 0)\n"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So the value for pvz->typ is still unknown but there is no warning?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What do you mean? pvz->typ is equal to 42 although we dont track that value. We just ensure that it wont be set to Uninit.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see

@amai2012 amai2012 requested a review from danmar August 29, 2019 05:25
@danmar danmar merged commit 03fe679 into cppcheck-opensource:master Aug 29, 2019
@pfultz2 pfultz2 deleted the uninitvar-9302 branch September 3, 2019 21:24
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.

3 participants