From 7b6dae070240c575905ef2ae2c0a5b8ed538b926 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 21 May 2024 22:19:33 +0200 Subject: [PATCH] Fix a couple of bugs spotted by Visual Studio --- src/SleighAnalValue.cpp | 8 ++++++-- src/r2ghidra.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/SleighAnalValue.cpp b/src/SleighAnalValue.cpp index f0aa62bc..ce3af9c0 100644 --- a/src/SleighAnalValue.cpp +++ b/src/SleighAnalValue.cpp @@ -1,4 +1,4 @@ -/* r2ghidra - LGPL - Copyright 2020-2023 - FXTi, pancake */ +/* r2ghidra - LGPL - Copyright 2020-2024 - FXTi, pancake */ #include "SleighAnalValue.h" @@ -70,7 +70,11 @@ SleighAnalValue SleighAnalValue::resolve_arg(RAnal *anal, const PcodeOperand *ar res.imm = (curr_op->type == CPUI_INT_ADD)? in0.imm + in1.imm : in0.imm - in1.imm; } else { res.base = in0.imm + in0.base; - res.base += (curr_op->type == CPUI_INT_ADD)? (in1.imm + in1.base) : -(in1.imm + in1.base); + if (curr_op->type == CPUI_INT_ADD) { + res.base += (in1.imm + in1.base); + } else { + res.base -= (in1.imm + in1.base); + } } res.mul = inner_max(in0.mul, in1.mul); // Only one of inputs should set mul res.delta = inner_max(in0.delta, in1.delta); diff --git a/src/r2ghidra.h b/src/r2ghidra.h index 21448b99..450c21aa 100644 --- a/src/r2ghidra.h +++ b/src/r2ghidra.h @@ -1,6 +1,7 @@ #ifndef R2GHIDRA_H #define R2GHIDRA_H +#undef R_LOG_ORIGIN #define R_LOG_ORIGIN "r2ghidra" #include