Skip to content

Commit

Permalink
Fix SETG_EA
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Jan 13, 2024
1 parent 326da42 commit f144f61
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 6 deletions.
8 changes: 3 additions & 5 deletions librz/analysis/arch/tricore/tricore_il.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,8 @@ static RzILOpPure *EA_off18(ut32 x) {

static RzILOpEffect *SETG_EA(const char *x, ut8 B, RzILOpPure *(*f)(RzILOpPure *, ut32)) {
RzILOpPure *v = LOADW(B, VARL("EA"));
v = f ? f(v, B) : v;
if (f) {
v = f(v, B);
v = UNSIGNED(reg_bits(x), f(v, B));
} else if (reg_bits(x) != B) {
v = UNSIGNED(reg_bits(x), v);
}
Expand Down Expand Up @@ -972,10 +971,9 @@ static RzILOpEffect *reverseV(const char *name, RzILOpPure *x, RzILOpPure *n) {
}

static RzAnalysisLiftedILOp ld_addr_abs(RzAsmTriCoreContext *ctx, ut8 B, RzILOpPure *(*f)(RzILOpPure *, ut32)) {
TriCoreMem m = M(0);
return SEQ2(
SETL("EA", EA_off18(m.disp)),
SETG_EA(m.reg, B, f));
SETL("EA", EA_off18(I(1))),
SETG_EA(R(0), B, f));
}

static RzILOpPure *EA_bso(TriCoreMem m) {
Expand Down
2 changes: 1 addition & 1 deletion librz/analysis/arch/tricore/tricore_il.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static RzILOpPure *SEXT64(RzILOpPure *value, ut32 length) {
return LET("_sext_val", SIGNED(32, value), rz_il_sextract64(VARLP("_sext_val"), U32(0), U32(length)));
}
static RzILOpPure *ZEXT32(RzILOpPure *value, ut32 length) {
return UNSIGNED(32, value);
return value;
}
static inline RzILOpPure *SHL0(RzILOpPure *value, ut32 length) {
return SHIFTL0(value, U32(length));
Expand Down
Loading

0 comments on commit f144f61

Please sign in to comment.