From b93b189a4cfb41f6c182ec0782ae6331d3bc2e7c Mon Sep 17 00:00:00 2001 From: Ricardo Baratto Date: Sun, 30 Aug 2026 18:33:54 -0400 Subject: [PATCH] REL: fix dict keys used in POs comparison in the json output generated by chkx relational compare all the POs that were in the original binary but are no longer in the patched binary were being put under the 'pos-added' key. And the ones that were not in the original binary but now are in the patched binary were under 'pos-removed'. Switch those around. --- chb/relational/InstructionRelationalAnalysis.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chb/relational/InstructionRelationalAnalysis.py b/chb/relational/InstructionRelationalAnalysis.py index aa63cccc..e293303d 100644 --- a/chb/relational/InstructionRelationalAnalysis.py +++ b/chb/relational/InstructionRelationalAnalysis.py @@ -217,19 +217,19 @@ def to_json_result(self) -> JSONResult: content["instr-2"] = i2result.content if self.is_po_changed: (pos1, pos2) = self.po_changes - content["pos-added"] = posadded = [] + content["pos-removed"] = posremoved = [] for po in pos1: ipo = po.to_json_result() if not ipo.is_ok: return JSONResult( "instructioncomparison", {}, "fail", ipo.reason) - posadded.append(ipo.content) - content["pos-removed"] = posremoved = [] + posremoved.append(ipo.content) + content["pos-added"] = posadded = [] for po in pos2: ipo = po.to_json_result() if not ipo.is_ok: return JSONResult( "instructioncomparison", {}, "fail", ipo.reason) - posremoved.append(ipo.content) + posadded.append(ipo.content) return JSONResult("instructioncomparison", content, "ok")