Fix undefined shifts (#1158)
Use multiply instead
Found by oss-fuzz
diff --git a/arch/AArch64/AArch64InstPrinter.c b/arch/AArch64/AArch64InstPrinter.c
index 0314e56..de2a4cf 100644
--- a/arch/AArch64/AArch64InstPrinter.c
+++ b/arch/AArch64/AArch64InstPrinter.c
@@ -1248,7 +1248,7 @@
// If the label has already been resolved to an immediate offset (say, when
// we're running the disassembler), just print the immediate.
if (MCOperand_isImm(Op)) {
- uint64_t imm = (MCOperand_getImm(Op) << 2) + MI->address;
+ uint64_t imm = (MCOperand_getImm(Op) * 4) + MI->address;
printUInt64Bang(O, imm);
if (MI->csh->detail) {
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].type = ARM64_OP_IMM;
diff --git a/arch/PowerPC/PPCInstPrinter.c b/arch/PowerPC/PPCInstPrinter.c
index e244513..561dd2a 100644
--- a/arch/PowerPC/PPCInstPrinter.c
+++ b/arch/PowerPC/PPCInstPrinter.c
@@ -533,7 +533,7 @@
return;
}
- imm = ((int)MCOperand_getImm(MCInst_getOperand(MI, OpNo)) << 2);
+ imm = ((int)MCOperand_getImm(MCInst_getOperand(MI, OpNo)) * 4);
if (!PPC_abs_branch(MI->csh, MCInst_getOpcode(MI))) {
imm = (int)MI->address + imm;