Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement one line foreach macros for hash tables. #4500

Closed
wants to merge 10 commits into from
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AlignConsecutiveMacros: true
AlignTrailingComments: false
AlignOperands: false
Cpp11BracedListStyle: false
ForEachMacros: ['rz_list_foreach', 'rz_list_foreach_safe', 'rz_vector_foreach', 'rz_vector_foreach_prev', 'rz_vector_enumerate', 'rz_pvector_foreach', 'rz_pvector_enumerate', 'rz_rbtree_foreach', 'rz_interval_tree_foreach', 'rz_skiplist_foreach', 'graph_foreach_anode']
ForEachMacros: ['rz_list_foreach', 'rz_list_foreach_safe', 'rz_vector_foreach', 'rz_vector_foreach_prev', 'rz_vector_enumerate', 'rz_pvector_foreach', 'rz_pvector_enumerate', 'rz_rbtree_foreach', 'rz_interval_tree_foreach', 'rz_skiplist_foreach', 'graph_foreach_anode', 'set_s_foreach', 'set_u_foreach', 'ht_foreach']
Rot127 marked this conversation as resolved.
Show resolved Hide resolved
SortIncludes: false
RequiresClausePosition: SingleLine
TypenameMacros: ['HT_', 'Ht_', 'HtName_']
6 changes: 3 additions & 3 deletions librz/arch/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,14 +799,14 @@ RZ_API RzAnalysisBlock *rz_analysis_block_chop_noreturn(RzAnalysisBlock *block,
if (entry && rz_list_contains(entry->fcns, fcn)) {
rz_analysis_block_recurse(entry, noreturn_successors_reachable_cb, succs);
}
ht_up_foreach(succs, noreturn_remove_unreachable_cb, fcn);
ht_up_foreach_cb(succs, noreturn_remove_unreachable_cb, fcn);
}
rz_list_free(fcns_cpy);

// This last step isn't really critical, but nice to have.
// Prepare to merge blocks with their predecessors if possible
RzPVector *merge_blocks = rz_pvector_new((RzListFree)rz_analysis_block_unref);
ht_up_foreach(succs, noreturn_get_blocks_cb, merge_blocks);
ht_up_foreach_cb(succs, noreturn_get_blocks_cb, merge_blocks);

// Free/unref BEFORE doing the merge!
// Some of the blocks might not be valid anymore later!
Expand Down Expand Up @@ -921,7 +921,7 @@ RZ_API void rz_analysis_block_automerge(RzPVector /*<RzAnalysisBlock *>*/ *block
}

// Get the single predecessors we might want to merge with
ht_up_foreach(relevant_fcns, automerge_get_predecessors_cb, &ctx);
ht_up_foreach_cb(relevant_fcns, automerge_get_predecessors_cb, &ctx);

// Now finally do the merging
// in this loop we remove non-reachable basic blocks and since
Expand Down
6 changes: 3 additions & 3 deletions librz/arch/dwarf_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1847,8 +1847,8 @@ static bool store_callable(void *u, ut64 k, const void *v) {
RZ_API void rz_analysis_dwarf_process_info(RzAnalysis *analysis, RzBinDWARF *dw) {
rz_return_if_fail(analysis && dw);
rz_analysis_dwarf_preprocess_info(analysis, dw);
ht_sp_foreach(analysis->debug_info->base_types_by_name, store_base_type, (void *)analysis);
ht_up_foreach(analysis->debug_info->callable_by_offset, store_callable, (void *)analysis);
ht_sp_foreach_cb(analysis->debug_info->base_types_by_name, store_base_type, (void *)analysis);
ht_up_foreach_cb(analysis->debug_info->callable_by_offset, store_callable, (void *)analysis);
}

static bool fixup_regoff_to_stackoff(RzAnalysis *a, RzAnalysisFunction *f,
Expand Down Expand Up @@ -2057,7 +2057,7 @@ static bool dwarf_integrate_function(void *user, const ut64 k, const void *value
*/
RZ_API void rz_analysis_dwarf_integrate_functions(RzAnalysis *analysis, RzFlag *flags) {
rz_return_if_fail(analysis && analysis->debug_info);
ht_up_foreach(analysis->debug_info->function_by_addr, dwarf_integrate_function, analysis);
ht_up_foreach_cb(analysis->debug_info->function_by_addr, dwarf_integrate_function, analysis);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion librz/arch/esil/esil_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ RZ_API void rz_analysis_esil_trace_restore(RzAnalysisEsil *esil, int idx) {
rz_list_foreach (esil->analysis->reg->allregs, iter, ri) {
restore_register(esil, ri, idx);
}
ht_up_foreach(trace->memory, restore_memory_cb, esil);
ht_up_foreach_cb(trace->memory, restore_memory_cb, esil);
}

static void print_instruction_ops(RzILTraceInstruction *instruction, int idx, RzILTraceInsOp focus) {
Expand Down
2 changes: 1 addition & 1 deletion librz/arch/function.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ RZ_API bool rz_analysis_function_relocate(RzAnalysisFunction *fcn, ut64 addr) {
.delta = delta
};
if (ctx.inst_vars_new) {
ht_up_foreach(fcn->inst_vars, inst_vars_relocate_cb, &ctx);
ht_up_foreach_cb(fcn->inst_vars, inst_vars_relocate_cb, &ctx);
// Do not free the elements of the Ht, because they were moved to ctx.inst_vars_new
fcn->inst_vars->opt.finiKV = NULL;
ht_up_free(fcn->inst_vars);
Expand Down
4 changes: 2 additions & 2 deletions librz/arch/hint.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ RZ_API void rz_analysis_hint_del(RzAnalysis *a, ut64 addr, ut64 size) {
}
// ranged delete
DeleteRangeCtx ctx = { a->addr_hints, addr, size };
ht_up_foreach(a->addr_hints, addr_hint_range_delete_cb, &ctx);
ht_up_foreach_cb(a->addr_hints, addr_hint_range_delete_cb, &ctx);
while (true) { // arch
RBNode *node = rz_rbtree_lower_bound(a->arch_hints, &addr, ranged_hint_record_cmp, NULL);
if (!node) {
Expand Down Expand Up @@ -421,7 +421,7 @@ static bool addr_hint_foreach_cb(void *user, const ut64 key, const void *value)

RZ_API void rz_analysis_addr_hints_foreach(RzAnalysis *analysis, RzAnalysisAddrHintRecordsCb cb, void *user) {
AddrHintForeachCtx ctx = { cb, user };
ht_up_foreach(analysis->addr_hints, addr_hint_foreach_cb, &ctx);
ht_up_foreach_cb(analysis->addr_hints, addr_hint_foreach_cb, &ctx);
}

RZ_API void rz_analysis_arch_hints_foreach(RzAnalysis *analysis, RzAnalysisArchHintCb cb, void *user) {
Expand Down
8 changes: 4 additions & 4 deletions librz/arch/serialize_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ static void function_store(RZ_NONNULL Sdb *db, const char *key, RzAnalysisFuncti

if (function->labels->count) {
pj_ko(j, "labels");
ht_up_foreach(function->labels, store_label_cb, j);
ht_up_foreach_cb(function->labels, store_label_cb, j);
pj_end(j);
}

Expand Down Expand Up @@ -1432,15 +1432,15 @@ static bool store_xrefs_list_cb(void *db, const ut64 k, const void *v) {
}
pj_a(j);
HtUP *ht = (HtUP *)v;
ht_up_foreach(ht, store_xref_cb, j);
ht_up_foreach_cb(ht, store_xref_cb, j);
pj_end(j);
sdb_set(db, key, pj_string(j));
pj_free(j);
return true;
}

RZ_API void rz_serialize_analysis_xrefs_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis) {
ht_up_foreach(analysis->ht_xrefs_from, store_xrefs_list_cb, db);
ht_up_foreach_cb(analysis->ht_xrefs_from, store_xrefs_list_cb, db);
}

static bool xrefs_load_cb(void *user, const SdbKv *kv) {
Expand Down Expand Up @@ -1890,7 +1890,7 @@ RZ_API void rz_serialize_analysis_hints_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAn
rz_analysis_addr_hints_foreach(analysis, addr_hint_acc_cb, acc);
rz_analysis_arch_hints_foreach(analysis, arch_hint_acc_cb, acc);
rz_analysis_bits_hints_foreach(analysis, bits_hint_acc_cb, acc);
ht_up_foreach(acc, hints_acc_store_cb, db);
ht_up_foreach_cb(acc, hints_acc_store_cb, db);
ht_up_free(acc);
}

Expand Down
2 changes: 1 addition & 1 deletion librz/arch/var_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ RZ_API RZ_OWN RzList /*<RzAnalysisVarGlobal *>*/ *rz_analysis_var_global_get_all
if (!globals) {
return NULL;
}
ht_sp_foreach(analysis->ht_global_var, global_var_collect_cb, globals);
ht_sp_foreach_cb(analysis->ht_global_var, global_var_collect_cb, globals);
return globals;
}

Expand Down
8 changes: 4 additions & 4 deletions librz/arch/xrefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static bool appendRef(void *u, const ut64 k, const void *v) {

static bool mylistrefs_cb(void *list, const ut64 k, const void *v) {
HtUP *ht = (HtUP *)v;
ht_up_foreach(ht, appendRef, list);
ht_up_foreach_cb(ht, appendRef, list);
return true;
}

Expand All @@ -77,11 +77,11 @@ static void sortxrefs(RzList /*<RzAnalysisXRef *>*/ *list) {

static void listxrefs(HtUP *m, ut64 addr, RzList /*<RzAnalysisXRef *>*/ *list) {
if (addr == UT64_MAX) {
ht_up_foreach(m, mylistrefs_cb, list);
ht_up_foreach_cb(m, mylistrefs_cb, list);
} else {
HtUP *d = ht_up_find(m, addr, NULL);
if (d) {
ht_up_foreach(d, appendRef, list);
ht_up_foreach_cb(d, appendRef, list);
}
}
}
Expand Down Expand Up @@ -262,7 +262,7 @@ static bool count_cb(void *user, const ut64 k, const void *v) {

RZ_API ut64 rz_analysis_xrefs_count(RzAnalysis *analysis) {
ut64 ret = 0;
ht_up_foreach(analysis->ht_xrefs_to, count_cb, &ret);
ht_up_foreach_cb(analysis->ht_xrefs_to, count_cb, &ret);
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion librz/bin/dwarf/abbrev.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,5 @@ RZ_API void rz_core_bin_dwarf_abbrevs_dump(
if (abbrevs->by_offset->count > 0) {
rz_strbuf_append(sb, ".debug_abbrevs content:\n");
}
ht_up_foreach(abbrevs->by_offset, cb_abbrev_table_dump, sb);
ht_up_foreach_cb(abbrevs->by_offset, cb_abbrev_table_dump, sb);
}
2 changes: 1 addition & 1 deletion librz/bin/dwarf/loclists.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,6 @@ RZ_API void rz_bin_dwarf_loclists_dump(
.dw = dw,
.sb = sb,
};
ht_up_foreach(loclists->by_offset, cb_loclist_dump, &ctx);
ht_up_foreach_cb(loclists->by_offset, cb_loclist_dump, &ctx);
rz_strbuf_append(sb, "\n");
}
2 changes: 1 addition & 1 deletion librz/bin/dwarf/rnglists.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,6 @@ RZ_API void rz_bin_dwarf_rnglists_dump(
if (rnglists->by_offset->count > 0) {
rz_strbuf_append(sb, ".debug_loclists content:\n");
}
ht_up_foreach(rnglists->by_offset, cb_rnglist_dump, sb);
ht_up_foreach_cb(rnglists->by_offset, cb_rnglist_dump, sb);
rz_strbuf_append(sb, "\n");
}
2 changes: 1 addition & 1 deletion librz/bin/format/pe/pe_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ RzPVector /*<char *>*/ *PE_(rz_bin_pe_get_libs)(RzBinPEObj *bin) {
}
}
RzPVector *vec = rz_set_s_to_vector(libs);
set_s_free(libs);
rz_set_s_free(libs);
return vec;
}

Expand Down
2 changes: 1 addition & 1 deletion librz/cons/canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ RZ_API void rz_cons_canvas_clear(RzConsCanvas *c) {
memset(c->b[y], '\n', c->bsize[y]);
}

ht_up_foreach(c->attrs, attribute_delete_cb, c->attrs);
ht_up_foreach_cb(c->attrs, attribute_delete_cb, c->attrs);
}

RZ_API bool rz_cons_canvas_gotoxy(RzConsCanvas *c, int x, int y) {
Expand Down
4 changes: 2 additions & 2 deletions librz/core/agraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -3856,7 +3856,7 @@ RZ_API void rz_agraph_foreach(RzAGraph *g, RzANodeCallback cb, void *user) {
.node_cb = cb,
.data = user
};
ht_sp_foreach(g->nodes, (HtSPForeachCallback)user_node_cb, &u);
ht_sp_foreach_cb(g->nodes, (HtSPForeachCallback)user_node_cb, &u);
}

RZ_API void rz_agraph_foreach_edge(RzAGraph *g, RAEdgeCallback cb, void *user) {
Expand All @@ -3865,7 +3865,7 @@ RZ_API void rz_agraph_foreach_edge(RzAGraph *g, RAEdgeCallback cb, void *user) {
.edge_cb = cb,
.data = user
};
ht_sp_foreach(g->nodes, (HtSPForeachCallback)user_edge_cb, &u);
ht_sp_foreach_cb(g->nodes, (HtSPForeachCallback)user_edge_cb, &u);
}

RZ_API RzANode *rz_agraph_get_first_node(const RzAGraph *g) {
Expand Down
2 changes: 1 addition & 1 deletion librz/core/basefind.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static void *basefind_thread_runner(BaseFindThreadData *bftd) {
bfd.score = 0;
bfd.start = base;
bfd.end = base + bftd->io_size;
ht_uu_foreach(bftd->pointers, (HtUUForeachCallback)basefind_pointer_map_iter, &bfd);
ht_uu_foreach_cb(bftd->pointers, (HtUUForeachCallback)basefind_pointer_map_iter, &bfd);

if (bfd.score < bftd->score_min) {
// ignore any score below than score_min
Expand Down
12 changes: 6 additions & 6 deletions librz/core/canalysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -3322,8 +3322,8 @@ static bool add_mmio_extended_flag_cb(void *user, const ut64 addr, const void *v
RZ_API void rz_platform_profile_add_flag_every_io(RzPlatformProfile *profile, RzFlag *flags) {
rz_flag_unset_all_in_space(flags, RZ_FLAGS_FS_MMIO_REGISTERS);
rz_flag_unset_all_in_space(flags, RZ_FLAGS_FS_MMIO_REGISTERS_EXTENDED);
ht_up_foreach(profile->registers_mmio, add_mmio_flag_cb, flags);
ht_up_foreach(profile->registers_extended, add_mmio_extended_flag_cb, flags);
ht_up_foreach_cb(profile->registers_mmio, add_mmio_flag_cb, flags);
ht_up_foreach_cb(profile->registers_extended, add_mmio_extended_flag_cb, flags);
}

static bool add_arch_platform_flag_comment_cb(void *user, const ut64 addr, const void *v) {
Expand All @@ -3348,7 +3348,7 @@ static bool add_arch_platform_flag_comment_cb(void *user, const ut64 addr, const
*/
RZ_API bool rz_platform_index_add_flags_comments(RzCore *core) {
rz_flag_unset_all_in_space(core->flags, RZ_FLAGS_FS_PLATFORM_PORTS);
ht_up_foreach(core->analysis->platform_target->platforms, add_arch_platform_flag_comment_cb, core);
ht_up_foreach_cb(core->analysis->platform_target->platforms, add_arch_platform_flag_comment_cb, core);
return true;
}

Expand Down Expand Up @@ -3661,7 +3661,7 @@ static bool process_reference_noreturn_cb(void *u, const ut64 k, const void *v)

static bool process_refs_cb(void *u, const ut64 k, const void *v) {
HtUP *ht = (HtUP *)v;
ht_up_foreach(ht, process_reference_noreturn_cb, u);
ht_up_foreach_cb(ht, process_reference_noreturn_cb, u);
return true;
}

Expand All @@ -3686,12 +3686,12 @@ RZ_API void rz_core_analysis_propagate_noreturn_relocs(RzCore *core, ut64 addr)
// List of the potentially noreturn functions
RzSetU *todo = rz_set_u_new();
struct core_noretl u = { core, noretl, todo };
ht_up_foreach(core->analysis->ht_xrefs_to, process_refs_cb, &u);
ht_up_foreach_cb(core->analysis->ht_xrefs_to, process_refs_cb, &u);
rz_list_free(noretl);
core->analysis->bits = bits1;
core->rasm->bits = bits2;
// For every function in todo list analyze if it's potentially become noreturn
ht_up_foreach(todo, reanalyze_fcns_cb, core);
ht_up_foreach_cb(todo, reanalyze_fcns_cb, core);
rz_set_u_free(todo);
}

Expand Down
2 changes: 1 addition & 1 deletion librz/core/cannotated_code.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,6 @@ RZ_API void rz_core_annotated_code_print_comment_cmds(RzAnnotatedCode *code) {
}
ht_up_update(ht, annotation->offset.offset, annotation);
}
ht_up_foreach(ht, foreach_offset_annotation, code);
ht_up_foreach_cb(ht, foreach_offset_annotation, code);
ht_up_free(ht);
}
2 changes: 1 addition & 1 deletion librz/core/cbin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ static void sections_print_json(RzCore *core, PJ *pj, RzBinObject *o, RzBinSecti
pj_end(pj);
return;
}
ht_ss_foreach(digests, digests_pj_cb, pj);
ht_ss_foreach_cb(digests, digests_pj_cb, pj);
ht_ss_free(digests);
}
pj_end(pj);
Expand Down
4 changes: 2 additions & 2 deletions librz/core/cfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static bool __rebase_xrefs_i(void *user, const ut64 k, const void *v) {

static bool __rebase_xrefs(void *user, const ut64 k, const void *v) {
HtUP *ht = (HtUP *)v;
ht_up_foreach(ht, __rebase_xrefs_i, user);
ht_up_foreach_cb(ht, __rebase_xrefs_i, user);
return true;
}

Expand Down Expand Up @@ -181,7 +181,7 @@ static void __rebase_everything(RzCore *core, RzPVector /*<RzBinSection *>*/ *ol
core->analysis->ht_xrefs_from = NULL;
core->analysis->ht_xrefs_to = NULL;
rz_analysis_xrefs_init(core->analysis);
ht_up_foreach(xrefs_from, __rebase_xrefs, &reb);
ht_up_foreach_cb(xrefs_from, __rebase_xrefs, &reb);
ht_up_free(xrefs_from);
ht_up_free(xrefs_to);

Expand Down
8 changes: 4 additions & 4 deletions librz/core/cmd/cmd_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ static void cmd_analysis_esil(RzCore *core, const char *input) {
break;
case 0: // "aeli" with no args
if (esil && esil->interrupts) {
ht_up_foreach(esil->interrupts, _aeli_iter, NULL);
ht_up_foreach_cb(esil->interrupts, _aeli_iter, NULL);
}
break;
case 'r': // "aelir"
Expand Down Expand Up @@ -4242,7 +4242,7 @@ static void print_stats(RzCore *core, HtSU *ht, RzAnalysisFunction *fcn, RzCmdSt
const char *name;
RzListIter *iter;
RzList *list = rz_list_newf(NULL);
ht_su_foreach(ht, (HtSUForeachCallback)list_keys_cb, list);
ht_su_foreach_cb(ht, (HtSUForeachCallback)list_keys_cb, list);
rz_list_sort(list, (RzListComparator)strcmp, NULL);
if (state->mode == RZ_OUTPUT_MODE_TABLE) {
RzTable *t = state->d.t;
Expand Down Expand Up @@ -4329,10 +4329,10 @@ RZ_IPI RzCmdStatus rz_analysis_function_all_opcode_stat_handler(RzCore *core, in

HtSU *db;
rz_list_foreach (dbs, iter, db) {
ht_su_foreach(db, (HtSUForeachCallback)add_keys_to_set_cb, keys_set);
ht_su_foreach_cb(db, (HtSUForeachCallback)add_keys_to_set_cb, keys_set);
}

ht_su_foreach(keys_set, (HtSUForeachCallback)list_keys_cb, keys);
ht_su_foreach_cb(keys_set, (HtSUForeachCallback)list_keys_cb, keys);
rz_list_sort(keys, (RzListComparator)strcmp, NULL);

RzTable *t = state->d.t;
Expand Down
4 changes: 2 additions & 2 deletions librz/core/cmd/cmd_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ RZ_API RZ_OWN RzList /*<RzCmdMacro *>*/ *rz_cmd_macro_list(RZ_NONNULL RzCmd *cmd
if (!res) {
return NULL;
}
ht_sp_foreach(cmd->macros, macros_to_list, res);
ht_sp_foreach_cb(cmd->macros, macros_to_list, res);
return res;
}

Expand Down Expand Up @@ -1833,7 +1833,7 @@ RZ_API void rz_cmd_macro_foreach(RZ_NONNULL RzCmd *cmd, RzCmdForeachMacroCb cb,
.user = user,
.cb = cb,
};
ht_sp_foreach(cmd->macros, macro_foreach_cb, &u);
ht_sp_foreach_cb(cmd->macros, macro_foreach_cb, &u);
}

/* RzCmdParsedArgs */
Expand Down
4 changes: 2 additions & 2 deletions librz/core/cmd/cmd_eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ RZ_API RZ_OWN RzPVector /*<char *>*/ *rz_core_get_themes(RZ_NONNULL RzCore *core

RzPVector *vec = rz_set_s_to_vector(themes);
if (!vec) {
set_s_free(themes);
rz_set_s_free(themes);
return NULL;
}
rz_pvector_push(vec, strdup("default"));
rz_pvector_sort(vec, (RzPVectorComparator)compare_strings, NULL);
set_s_free(themes);
rz_set_s_free(themes);
return vec;
}

Expand Down
4 changes: 2 additions & 2 deletions librz/core/cmd/cmd_flag.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ RZ_IPI RzCmdStatus rz_flag_local_list_handler(RzCore *core, int argc, const char
}
rz_cmd_state_output_array_start(state);
PrintFcnLabelsCtx ctx = { fcn, state };
ht_up_foreach(fcn->labels, print_function_labels_cb, &ctx);
ht_up_foreach_cb(fcn->labels, print_function_labels_cb, &ctx);
rz_cmd_state_output_array_end(state);
return RZ_CMD_STATUS_OK;
}
Expand All @@ -286,7 +286,7 @@ RZ_IPI RzCmdStatus rz_flag_local_list_all_handler(RzCore *core, int argc, const
pj_k(state->d.pj, fcn->name);
}
PrintFcnLabelsCtx ctx = { fcn, state };
ht_up_foreach(fcn->labels, print_function_labels_cb, &ctx);
ht_up_foreach_cb(fcn->labels, print_function_labels_cb, &ctx);
if (state->mode == RZ_OUTPUT_MODE_JSON) {
pj_end(state->d.pj);
}
Expand Down
Loading
Loading