Fix #6296 - Set esil->cmd to fix regression

This commit is contained in:
pancake 2016-12-09 22:42:43 +01:00
parent 6296f4b794
commit 8d02b7fece
3 changed files with 13 additions and 3 deletions

View File

@ -140,8 +140,9 @@ R_API int r_anal_esil_fire_interrupt(RAnalEsil *esil, int interrupt) {
char t[128];
char *i;
RAnalEsilInterruptCB icb;
if (!esil)
if (!esil) {
return false;
}
if (esil->cmd) {
if (esil->cmd (esil, esil->cmd_intr, interrupt, 0)) {
return true;
@ -2532,8 +2533,9 @@ R_API void r_anal_esil_stack_free(RAnalEsil *esil) {
R_API int r_anal_esil_condition(RAnalEsil *esil, const char *str) {
char *popped;
int ret;
if (!esil)
if (!esil) {
return false;
}
while (*str == ' ') str++; // use proper string chop?
ret = r_anal_esil_parse (esil, str);
popped = r_anal_esil_pop (esil);

View File

@ -937,7 +937,7 @@ static int cb_hexpairs(void *user, void *data) {
return true;
}
static int r_core_esil_cmd(RAnalEsil *esil, const char *cmd, int a1, int a2) {
R_API int r_core_esil_cmd(RAnalEsil *esil, const char *cmd, int a1, int a2) {
if (cmd && *cmd) {
RCore *core = esil->anal->user;
r_core_cmdf (core, "%s %d %d", cmd, a1, a2);

View File

@ -2093,6 +2093,7 @@ void cmd_anal_reg(RCore *core, const char *str) {
}
}
R_API int r_core_esil_cmd(RAnalEsil *esil, const char *cmd, int a1, int a2);
R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr) {
// Stepping
int ret;
@ -2100,6 +2101,13 @@ R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr)
RAnalOp op;
RAnalEsil *esil = core->anal->esil;
const char *name = r_reg_get_name (core->anal->reg, R_REG_NAME_PC);
if (!esil) {
r_core_cmd0 (core, "aei");
esil = core->anal->esil;
}
if (esil) {
esil->cmd = r_core_esil_cmd;
}
ut64 addr = r_reg_getv (core->anal->reg, name);
r_cons_break_push (NULL, NULL);
repeat: