Skip to content

Commit

Permalink
Attempt to fix radareorg#10693 issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen authored and radare committed Jul 17, 2018
1 parent 927bfba commit c5ec231
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion libr/core/canal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3600,6 +3600,7 @@ R_API void r_core_anal_fcn_merge (RCore *core, ut64 addr, ut64 addr2) {
RAnalBlock *bb;
RAnalFunction *f1 = r_anal_get_fcn_at (core->anal, addr, 0);
RAnalFunction *f2 = r_anal_get_fcn_at (core->anal, addr2, 0);
RAnalFunction *f3 = NULL;
if (!f1 || !f2) {
eprintf ("Cannot find function\n");
return;
Expand Down Expand Up @@ -3647,7 +3648,12 @@ R_API void r_core_anal_fcn_merge (RCore *core, ut64 addr, ut64 addr2) {
// resize
f2->bbs = NULL;
r_anal_fcn_tree_delete (&core->anal->fcn_tree, f2);
r_list_delete_data (core->anal->fcns, f2);
r_list_foreach (core->anal->fcns, iter, f2) {
if (f2 == f3) {
r_list_delete (core->anal->fcns, iter);
f3->bbs = NULL;
}
}
}

R_API void r_core_anal_auto_merge (RCore *core, ut64 addr) {
Expand Down
4 changes: 2 additions & 2 deletions libr/util/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,11 @@ int main () {

{
char *str;
r_list_foreach(l, iter, str) {
r_list_foreach (l, iter, str) {
printf("-- %s\n", str);
}
printf("--**--\n");
r_list_foreach_prev(l, iter, str) {
r_list_foreach_prev (l, iter, str) {
printf("-- %s\n", str);
}
}
Expand Down

0 comments on commit c5ec231

Please sign in to comment.