Skip to content

Commit

Permalink
asm.symbol: Improve code/test a bit more (#15798) ##disasm
Browse files Browse the repository at this point in the history
  • Loading branch information
kazarmy authored and radare committed Jan 14, 2020
1 parent 32d8fd8 commit bf80920
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 1 addition & 4 deletions libr/core/disasm.c
Expand Up @@ -2674,10 +2674,7 @@ static void ds_print_lines_left(RDisasmState *ds) {
sfi.name = ds->fcn->name;
ds->lastflag = &sfi;
} else {
RFlagItem *fi = r_flag_get_at (core->flags, ds->at, false);
if (!fi && !ds->lastflag) {
fi = r_flag_get_at (core->flags, ds->at, true);
}
RFlagItem *fi = r_flag_get_at (core->flags, ds->at, !ds->lastflag);
if (fi) { // && (!ds->lastflag || fi->offset != ds->at))
sfi.offset = fi->offset;
sfi.name = fi->name;
Expand Down
8 changes: 8 additions & 0 deletions test/new/db/cmd/cmd_pd2
Expand Up @@ -780,6 +780,9 @@ pd 2
?e
s segment.LOAD0 + 83
pd 4
?e
s entry0
pd 3
EOF
EXPECT=<<EOF
entry0 + 2 xor eax, eax
Expand All @@ -790,5 +793,10 @@ EXPECT=<<EOF
entry0 + 0 mov bl, 0x2a
entry0 + 2 xor eax, eax
entry0 + 4 inc eax

entry0 + 0 ;-- entry0:
entry0 + 0 mov bl, 0x2a
entry0 + 2 xor eax, eax
entry0 + 4 inc eax
EOF
RUN

0 comments on commit bf80920

Please sign in to comment.