Fixed tcg temp alloc without free in mips tcg translation#2305
Open
justdaniel-gh wants to merge 1 commit intounicorn-engine:devfrom
Open
Fixed tcg temp alloc without free in mips tcg translation#2305justdaniel-gh wants to merge 1 commit intounicorn-engine:devfrom
justdaniel-gh wants to merge 1 commit intounicorn-engine:devfrom
Conversation
| // Map a page of NOPs (0x00); exercises a potential for a bug when a TB contains | ||
| // more instructions than temp slots (if temp tcg vars are not freed) | ||
| uc_mem_map(uc, base, 0x1000, UC_PROT_READ | UC_PROT_EXEC | UC_PROT_WRITE); | ||
| uc_ctl_request_cache(uc, base, &tb); |
Contributor
There was a problem hiding this comment.
can you also use OK() for the other two uc calls and add a OK(uc_close(uc))
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.
Fixes #2240
Calls to tcg_const_i32 end up calling tcg_temp_alloc (in tcg.c:tcg_temp_new_internal), which allocates a temp var in ctx->temps[]. tcg_temp_free_i32 should be called to free the allocated temp var.
Without it, ctx->temps will eventually overflow ctx->ops and SEGFAULT.