Fix asm tokens leaking horrendously because they used Vector and PVector#5019
Merged
notxvilka merged 12 commits intorizinorg:devfrom Mar 31, 2025
Merged
Fix asm tokens leaking horrendously because they used Vector and PVector#5019notxvilka merged 12 commits intorizinorg:devfrom
notxvilka merged 12 commits intorizinorg:devfrom
Conversation
wargio
approved these changes
Mar 20, 2025
notxvilka
approved these changes
Mar 20, 2025
Member
Author
|
Still missed some somewhere. |
5 tasks
notxvilka
approved these changes
Mar 26, 2025
Contributor
notxvilka
left a comment
There was a problem hiding this comment.
LGTM. The only doubt I have is that _free() function in the _init()
notxvilka
approved these changes
Mar 30, 2025
Contributor
notxvilka
left a comment
There was a problem hiding this comment.
This approach is certainly better!
Contributor
|
@wargio take a look again please |
The RzAsmOp passed here could be a previously initialized one. With allocated asm_tokens. Doing memset just leaks those tokens.
In practice rz_asm_op_init() is the best place to free the asm_toks reliably. Simply because this is always called in the old code, before an instruction is disassembled. Only in fini() is not enough, because there are too many place it is not called, leaking the tokens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Your checklist for this pull request
RZ_APIfunction and struct this PR changes.RZ_API).Detailed description
I must have missed some places back then, when converting to pvector. And it leaked like there is no tomorrow.
This should fix it now.
#5015 is still valid, but I probably ran the wrong build (without LSAN). Hence thought it fixed it.
Test plan
All green
Closing issues
...