Fix #7774 - Fix xrefs when saving/loading projects

This commit is contained in:
Jonathan Burnham 2017-08-02 20:32:03 +01:00 committed by radare
parent e3ee2fca64
commit 59c5a49623
2 changed files with 4 additions and 4 deletions

View File

@ -2043,13 +2043,13 @@ static int fcn_print_detail(RCore *core, RAnalFunction *fcn) {
r_list_foreach (fcn->refs, refiter, refi) {
switch (refi->type) {
case R_ANAL_REF_TYPE_CALL:
r_cons_printf ("afxC 0x%"PFMT64x" 0x%"PFMT64x"\n", fcn->addr, refi->addr);
r_cons_printf ("afxC 0x%"PFMT64x" 0x%"PFMT64x"\n", refi->at, refi->addr);
break;
case R_ANAL_REF_TYPE_DATA:
r_cons_printf ("afxd 0x%"PFMT64x" 0x%"PFMT64x"\n", fcn->addr, refi->addr);
r_cons_printf ("afxd 0x%"PFMT64x" 0x%"PFMT64x"\n", refi->at, refi->addr);
break;
case R_ANAL_REF_TYPE_CODE:
r_cons_printf ("afxc 0x%"PFMT64x" 0x%"PFMT64x"\n", fcn->addr, refi->addr);
r_cons_printf ("afxc 0x%"PFMT64x" 0x%"PFMT64x"\n", refi->at, refi->addr);
break;
}
}

View File

@ -2169,7 +2169,7 @@ static int cmd_anal_fcn(RCore *core, const char *input) {
*p = 0;
a = r_num_math (core->num, mi + 3);
b = r_num_math (core->num, p + 1);
fcn = r_anal_get_fcn_in (core->anal, a, R_ANAL_FCN_TYPE_ROOT);
fcn = r_anal_get_fcn_in (core->anal, a, R_ANAL_FCN_TYPE_NULL);
if (fcn) {
r_anal_fcn_xref_add (core->anal, fcn, a, b, input[2]);
} else eprintf ("Cannot add reference to non-function\n");