Fix #12544 - 'jalr t9' is an alias for 'jalr ra ra t9' (#12551)

This commit is contained in:
radare 2018-12-24 11:28:33 +01:00 committed by Anton Kochkov
parent 930dfcd110
commit 1fcf1bb784
2 changed files with 13 additions and 2 deletions

View File

@ -153,6 +153,17 @@ R_IPI int mips_assemble(const char *str, ut64 pc, ut8 *out) {
r_str_replace_char (s, ')', ' ');
*out = 0;
*w0=*w1=*w2=*w3=0;
if (!strncmp (s, "jalr", 4) && !strstr (s, ",")) {
char opstr[32];
const char *arg = strchr (s, ' ');
if (arg) {
snprintf (opstr, sizeof (opstr), "jalr ra ra %s", arg + 1);
free (s);
s = strdup (opstr);
}
}
sscanf (s, "%31s", w0);
if (*w0) {
for (i = 0; ops[i].name; i++) {

View File

@ -264,14 +264,14 @@ static int cb_analmaxrefs(void *user, void *data) {
return true;
}
static int cb_analnopskip (void *user, void *data) {
static int cb_analnopskip(void *user, void *data) {
RCore *core = (RCore*) user;
RConfigNode *node = (RConfigNode*) data;
core->anal->opt.nopskip = node->i_value;
return true;
}
static int cb_analhpskip (void *user, void *data) {
static int cb_analhpskip(void *user, void *data) {
RCore *core = (RCore*) user;
RConfigNode *node = (RConfigNode*) data;
core->anal->opt.hpskip = node->i_value;