Fix r_anal_get_bbaddr to include internal addrs ##anal (#17309)

This commit is contained in:
Dennis Goodlett 2020-07-21 04:16:28 -04:00 committed by GitHub
parent 5dd63b77fb
commit 9869a4d8f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -115,6 +115,6 @@ R_API ut64 r_anal_bb_size_i(RAnalBlock *bb, int i) {
/* returns the address of the basic block that contains addr or UT64_MAX if
* there is no such basic block */
R_API ut64 r_anal_get_bbaddr(RAnal *anal, ut64 addr) {
RAnalBlock *bb = r_anal_get_block_at (anal, addr);
RAnalBlock *bb = r_anal_bb_from_offset (anal, addr);
return bb? bb->addr: UT64_MAX;
}

View File

@ -355,3 +355,17 @@ EXPECT=<<EOF
0x20
EOF
RUN
NAME=seek to bb start (sb)
FILE=bins/elf/vim
CMDS=<<EOF
s 0x543a0
af
s+3
sb
?v $$
EOF
EXPECT=<<EOF
0x543a0
EOF
RUN