Closed arkup closed 5 years ago
When Eliminate unreachable code
is unchecked, it does get counter = counter + lVar1 & 0xffff
with lVar1=0xffffffffffffffff
Looks like a problem with the 'se_bmaski' instruction. You can try the following patch on your Ghidra installation as an immediate fix.
diff --git a/Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc b/Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
index 587a4e4e..f3d4a42f 100644
--- a/Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
+++ b/Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
@@ -720,9 +720,8 @@ IMM16B: val is IMM_0_10_VLE & IMM_16_20_VLE [ val = (IMM_16_20_VLE << 11) |
:se_bmaski RX_VLE,OIM5_VLE is $(ISVLE) & OP6_VLE=11 & BIT9_VLE=0 & RX_VLE & OIM5_VLE {
RX_VLE = ~0;
- tmp:1 = OIM5_VLE;
- if (tmp == 0) goto inst_next;
- RX_VLE = RX_VLE >> ($(REGISTER_SIZE) - tmp);
+ sa:4 = (8 * $(REGISTER_SIZE) - OIM5_VLE) * zext( OIM5_VLE != 0:1 );
+ RX_VLE = RX_VLE >> sa;
}
:se_bseti RX_VLE,OIM5_VLE is $(ISVLE) & OP6_VLE=25 & BIT9_VLE=0 & RX_VLE & OIM5_VLE {
Describe the bug
I've noticed that in PowerPC VLE mem copy function is not decompiled correctly showing infinity loop
To Reproduce
Expected behavior
Screenshots N/A
Attachments N/A
Environment
Additional context N/A