Skip to content

Commit

Permalink
Fix a couple of bugs spotted by Visual Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 21, 2024
1 parent 8a6c24d commit 7b6dae0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SleighAnalValue.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* r2ghidra - LGPL - Copyright 2020-2023 - FXTi, pancake */
/* r2ghidra - LGPL - Copyright 2020-2024 - FXTi, pancake */

#include "SleighAnalValue.h"

Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/r2ghidra.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef R2GHIDRA_H
#define R2GHIDRA_H

#undef R_LOG_ORIGIN
#define R_LOG_ORIGIN "r2ghidra"

#include <r_core.h>
Expand Down

0 comments on commit 7b6dae0

Please sign in to comment.