Fix NULL node warning in VV ##graph

This commit is contained in:
Dennis Goodlett 2021-11-18 17:42:58 -05:00 committed by GitHub
parent e77b0e7f67
commit f2373443c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2313,12 +2313,17 @@ static void add_child(RCore *core, RAGraph *g, RANode *u, ut64 jump) {
}
char *title = get_title (jump);
RANode *v = r_agraph_get_node (g, title);
ut64 a = r_num_get (NULL, u->title);
ut64 b = r_num_get (NULL, title);
if (v) {
ut64 a = r_num_get (NULL, u->title);
char key[64];
const char *fmt = "agraph.edge.0x%" PFMT64x "_0x%" PFMT64x ".highlight";
snprintf (key, sizeof (key), fmt, a, jump);
bool hl = sdb_exists (core->sdb, key);
r_agraph_add_edge (g, u, v, hl);
} else {
eprintf ("[!!] Failed to add child node 0x%" PFMT64x " to %s. Child not found\n", jump, u->title);
}
free (title);
const char *k = sdb_fmt ("agraph.edge.0x%"PFMT64x"_0x%"PFMT64x".highlight", a, b);
bool hl = sdb_exists (core->sdb, k);
r_agraph_add_edge (g, u, v, hl);
}
/* build the RGraph inside the RAGraph g, starting from the Basic Blocks */