Skip to content

initialize refCount in doSetWithDirty#320

Merged
tobgu merged 1 commit intotobgu:masterfrom
abio-arista:abio-patch
Jan 6, 2026
Merged

initialize refCount in doSetWithDirty#320
tobgu merged 1 commit intotobgu:masterfrom
abio-arista:abio-patch

Conversation

@abio-arista
Copy link
Copy Markdown
Contributor

Fixes #319

doSetWithDirty allocates a new VNode via allocNode, but does not
initialize the refCount field. As a result, releaseNode may later
read an uninitialized value, triggering Valgrind warnings and undefined
behavior.
This PR explicitly initializes resultNode->refCount in doSetWithDirty after
calling allocNode.

Copy link
Copy Markdown
Owner

@tobgu tobgu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@tobgu tobgu merged commit 25c47b9 into tobgu:master Jan 6, 2026
5 checks passed
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.

doSetWithDirty fails to initialize refCount after calling allocNode

2 participants