Fix call flag in CFG json output. (#6639)

This commit is contained in:
Rot127 2026-07-29 14:54:41 +00:00 committed by GitHub
parent 60514e78f9
commit f05d8e228b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -336,7 +336,7 @@ RZ_API void rz_graph_drawable_to_json(RZ_NONNULL RzGraph /*<RzGraphNodeInfo *, N
pj_kb(pj, "is_malloc", print_node->type & RZ_GRAPH_NODE_SUBTYPE_ICFG_MALLOC);
} else if (print_node->type == RZ_GRAPH_NODE_TYPE_CFG) {
pj_kn(pj, "address", print_node->cfg.address);
pj_kb(pj, "is_call", print_node->type & RZ_GRAPH_NODE_SUBTYPE_CFG_CALL);
pj_kb(pj, "is_call", print_node->subtype & RZ_GRAPH_NODE_SUBTYPE_CFG_CALL);
if (print_node->subtype & RZ_GRAPH_NODE_SUBTYPE_CFG_CALL && print_node->cfg.call_address != UT64_MAX) {
pj_kn(pj, "call_address", print_node->cfg.call_address);
}

View file

@ -617,6 +617,7 @@ FILE=bins/elf/analysis/x86_cfg_test
CMDS=<<EOF
s sym.ignore_call
agF
agF json
EOF
EXPECT=<<EOF
.-----------------.
@ -652,6 +653,7 @@ EXPECT=<<EOF
.-----------------.
| 0x80000ce (r) |
`-----------------'
{"nodes":[{"id":0,"address":134217923,"is_call":false,"is_entry":true,"is_exit":false,"is_return":false,"out_nodes":[1]},{"id":1,"address":134217924,"is_call":false,"is_entry":false,"is_exit":false,"is_return":false,"out_nodes":[2]},{"id":2,"address":134217927,"is_call":true,"call_address":134218600,"is_entry":false,"is_exit":false,"is_return":false,"out_nodes":[3]},{"id":3,"address":134217932,"is_call":false,"is_entry":false,"is_exit":false,"is_return":false,"out_nodes":[4]},{"id":4,"address":134217933,"is_call":false,"is_entry":false,"is_exit":false,"is_return":false,"out_nodes":[5]},{"id":5,"address":134217934,"is_call":false,"is_entry":false,"is_exit":false,"is_return":true,"out_nodes":[]}]}
EOF
RUN