cstest: Compare the PPC branch details once and without requiring operands - #3058
Open
phix33 wants to merge 1 commit into
Open
cstest: Compare the PPC branch details once and without requiring operands#3058phix33 wants to merge 1 commit into
phix33 wants to merge 1 commit into
Conversation
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
Detailed description
A ppc test case that supplies
bc:expectations but nooperands:passes without comparing anything.tests/details/ppc.yamlalready has one (bdnzlrl+): change any of itsbc:values to garbage —and
cstest tests/details/ppc.yamlstill reports all tests succeeded.test_expected_ppcreturned early whenexpected->operands_count == 0, and the wholeexpected->bcblock sat inside the operand loop so branch details were compared once per operand, or not at all for an operand-less case. The block is hoisted out of the loop and the early return replaced with a guard around the operand comparison only.expected->operands_countrather thanactual->op_count: with the early return gone, the old bound would dereference a NULLexpected->operands[i]for an operand-less case.Test plan
One new case:
bdnzflr 4*cr5+eq(4c 16 00 20) with a fullbc:block and deliberately nooperands:. Any wrong value in it (or in the existingbdnzlrl+case) passes on unpatchednextand fails with this fix.The other arch comparers don't have this shape: only ppc keeps an instruction-wide block inside its operand loop; the aarch64/arm/sparc/x86 early returns skip operand comparisons only.
Closing issues
None.