Skip to content

Commit

Permalink
Hide the shift overflow warnings under esil.verbose ##anal
Browse files Browse the repository at this point in the history
  • Loading branch information
XVilka authored and radare committed Aug 21, 2019
1 parent 6e58c67 commit 7f9b8bd
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions libr/anal/esil.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ if (esil) {\
} \
}

/* internal helper functions */
static void err(RAnalEsil *esil, const char *msg) {
if (esil->verbose) {
eprintf ("0x%08" PFMT64x " %s\n", esil->address, msg);
}
}
#define ERR(x) err(esil,x)

/* Returns the number that has bits + 1 least significant bits set. */
static inline ut64 genmask(int bits) {
ut64 m = UT64_MAX;
Expand All @@ -37,6 +29,8 @@ static inline ut64 genmask(int bits) {
return m;
}

#define ERR(x) if (esil->verbose) { eprintf ("%s\n", x); }

static bool isnum(RAnalEsil *esil, const char *str, ut64 *num) {
if (!esil || !str) {
return false;
Expand Down Expand Up @@ -488,7 +482,9 @@ R_API int r_anal_esil_get_parm_size(RAnalEsil *esil, const char *str, ut64 *num,
}
return true;
default:
IFDBG eprintf ("Invalid arg (%s)\n", str);
if (esil->verbose) {
eprintf ("Invalid arg (%s)\n", str);
}
esil->parse_stop = 1;
break;
}
Expand Down Expand Up @@ -1108,7 +1104,9 @@ static bool esil_lsreq(RAnalEsil *esil) {
if (dst && r_anal_esil_reg_read (esil, dst, &num, NULL)) {
if (src && r_anal_esil_get_parm (esil, src, &num2)) {
if (num2 > 63) {
eprintf ("Invalid shift at 0x%08"PFMT64x"\n", esil->address);
if (esil->verbose) {
eprintf ("Invalid shift at 0x%08"PFMT64x"\n", esil->address);
}
num2 = 63;
}
esil->old = num;
Expand Down Expand Up @@ -1192,7 +1190,9 @@ static bool esil_asreq(RAnalEsil *esil) {
// r_anal_esil_pushnum (esil, res);
ret = true;
} else {
ERR ("esil_asr: empty stack");
if (esil->verbose) {
eprintf ("esil_asr: empty stack");
}
}
}
free (param);
Expand Down Expand Up @@ -3075,7 +3075,7 @@ R_API int r_anal_esil_condition(RAnalEsil *esil, const char *str) {
}
free (popped);
} else {
ERR ("ESIL stack is empty");
eprintf ("Warning: Cannot pop because The ESIL stack is empty");
return -1;
}
return ret;
Expand Down

0 comments on commit 7f9b8bd

Please sign in to comment.