Skip to content

Commit

Permalink
Fix for local labels
Browse files Browse the repository at this point in the history
  • Loading branch information
XVilka committed Jul 10, 2013
1 parent 21ed694 commit 253b3f1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions libr/core/disasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,33 +851,35 @@ R_API int r_core_print_disasm(RPrint *p, RCore *core, ut64 addr, ut8 *buf, int l
analop.jump, R_ANAL_FCN_TYPE_NULL);
RAnalFunction *cf = r_anal_fcn_find (core->anal, /* current function */
at, R_ANAL_FCN_TYPE_NULL);
ut8 have_local = 0;
if (f && !strstr (opstr, f->name)) {
if (f->locals != NULL) {
RAnalFcnLocal *l;
RListIter *iter;
r_list_foreach (f->locals, iter, l) {
if (analop.jump == l->addr) {
if ((cf != NULL) && (f == cf)) {
if ((cf != NULL) && (f->addr == cf->addr)) {
r_cons_strcat (color_label);
r_cons_printf (" ; (%s)", l->name);
r_cons_strcat (Color_RESET);
break;
} else {
r_cons_strcat (color_fname);
r_cons_printf ("; (%s", f->name);
r_cons_strcat (Color_RESET);
r_cons_strcat (color_label);
r_cons_printf (".%s)", l->name);
r_cons_strcat (Color_RESET);
break;
}
have_local = 1;
break;
}
}
}

r_cons_strcat (color_fname);
r_cons_printf (" ; (%s)", f->name);
r_cons_strcat (Color_RESET);
if (!have_local) {
r_cons_strcat (color_fname);
r_cons_printf (" ; (%s)", f->name);
r_cons_strcat (Color_RESET);
}
}
}
break;
Expand Down

0 comments on commit 253b3f1

Please sign in to comment.