From 594a339a77c9ea575b371c5399c3fe7ada470670 Mon Sep 17 00:00:00 2001 From: Sajid Date: Wed, 18 Sep 2024 13:32:30 +0600 Subject: [PATCH] Add label count by 1 --- PowerAnalyse/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerAnalyse/main.cpp b/PowerAnalyse/main.cpp index 6a19c7b..9bf201c 100644 --- a/PowerAnalyse/main.cpp +++ b/PowerAnalyse/main.cpp @@ -117,7 +117,7 @@ void ScanTable(const uint32_t* code, size_t base, SwitchTable& table) cr = insn.operands[0]; if (insn.opcode->operands[1] != 0) { - table.defaultLabel = insn.operands[1] + 1; + table.defaultLabel = insn.operands[1]; } } else if (cr != -1) @@ -125,7 +125,7 @@ void ScanTable(const uint32_t* code, size_t base, SwitchTable& table) if (insn.opcode->id == PPC_INST_CMPLWI && insn.operands[0] == cr) { table.r = insn.operands[1]; - table.labels.resize(insn.operands[2]); + table.labels.resize(insn.operands[2] + 1); table.base = base; break; }