Another fix for xrefs

This commit is contained in:
pancake 2014-10-21 01:02:25 +02:00
parent 8b7d4b033c
commit 1c7b576f1b
2 changed files with 6 additions and 2 deletions

View File

@ -58,6 +58,10 @@ R_API int r_anal_xrefs_set (RAnal *anal, const RAnalRefType type,
char key[32];
if (!anal || !DB)
return R_FALSE;
// unknown refs should not be stored. seems wrong
if (type == R_ANAL_REF_TYPE_NULL) {
return R_FALSE;
}
XREFKEY (key, sizeof (key), "ref", type, from);
sdb_array_add_num (DB, key, to, 0);
XREFKEY (key, sizeof (key), "xref", type, to);
@ -105,7 +109,7 @@ R_API RList *r_anal_xrefs_get (RAnal *anal, ut64 to) {
r_anal_xrefs_from (anal, list, "xref", R_ANAL_REF_TYPE_CALL, to);
r_anal_xrefs_from (anal, list, "xref", R_ANAL_REF_TYPE_DATA, to);
r_anal_xrefs_from (anal, list, "xref", R_ANAL_REF_TYPE_STRING, to);
if (r_list_length (list)<1) {
if (r_list_empty (list)) {
r_list_free (list);
list = NULL;
}

View File

@ -805,7 +805,7 @@ R_API int r_core_anal_fcn(RCore *core, ut64 at, ut64 from, int reftype, int dept
r_list_append (fcn->xrefs, ref);
#endif
// XXX this is creating dupped entries in the refs list with invalid reftypes, wtf?
//r_anal_xrefs_set (core->anal, reftype, from, at);
r_anal_xrefs_set (core->anal, reftype, from, at);
}
// XXX: this is wrong. See CID 1134565
r_anal_fcn_insert (core->anal, fcn);