Skip to content

[flang-rt] Fixed uninitialized class member variable #127681

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

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

eugeneepshteyn
Copy link
Contributor

valgrind complained that OpenStatementState::pathLength_ was used before it was initialized, when a file was opened with status='scratch'. The code seems to expect that pathLengh_ should be initialized to 0, so added default initialization to the declaration.

valgrind complained that `OpenStatementState::pathLength_` was used before it
was initialized, when a file was opened with `status='scratch'`. The code
seems to expect that `pathLengh_` should be initialized to 0, so added default
initialization to the declaration.
Copy link
Contributor

@vdonaldson vdonaldson left a comment

Choose a reason for hiding this comment

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

This looks ok to me, assuming that default initialization doesn't apply, which a few minutes of language research seems to indicate.

@eugeneepshteyn eugeneepshteyn merged commit 01f2f81 into llvm:main Feb 18, 2025
7 checks passed
@eugeneepshteyn eugeneepshteyn deleted the valgrind-io-fix branch February 18, 2025 20:52
wldfngrs pushed a commit to wldfngrs/llvm-project that referenced this pull request Feb 19, 2025
valgrind complained that `OpenStatementState::pathLength_` was used
before it was initialized, when a file was opened with
`status='scratch'`. The code seems to expect that `pathLengh_` should be
initialized to 0, so added default initialization to the declaration.
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