gh-133590: Initialize TableEntry.linenumber_borrow. #133681
Open
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the author decided to initialize
filename_borrow
to NULL, I think thatlinenumber_borrow
should also be initialized (likely to 0).In its current state it could become an issue in the report_leak() function if for some reason
entry->linenumber_borrow = linenumber;
fails to be executed and then linenumber_borrow is accessed when filename_borrow is non-NULL. I'm not sure if this code path is possible at all, but initializing linenumber_borrow shouldn't have any side-effects.If this was left intentionally uninitialized for some reason, it would be a good idea to close this PR and open another one documenting the motive behind leaving it like this.
Also, stackrefs.c had a blank line at the beginning of the file (!!); I took the liberty to remove it.
linenumber_borrow
field of theTableEntry
struct #133590