[PPC] Fix random branch hint and update_cr0
set up.
#2028
Merged
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.
The branch hint and the
update_cr0
flag can be set to true at random.Those flags are set here:
capstone/arch/PowerPC/PPCInstPrinter.c
Lines 77 to 92 in dc69f00
Because the
cs_insn->mnemonic
gets filled after thePPC_post_printer()
is called andcs_insn->mnemonic
is not memset to 0 before,PPC_post_printer()
testscs_insn->mnemonic
with random data.This in turn leads randomly to incorrect setting of the branch hints and the
update_cr0
flag.The branch hints and
update_cr0
flag will no longer set by checking the mnemonic once theauto-sync
update is done. So this is really just a hotfix until #2013 is merged.