rizin/librz/arch
NOT XVilka f4e477388b
librz/arch: render flag-enum operands as an OR of members (#2344) (#6450)
An enum type hint set on an operand (ahie) only replaced the immediate when its
value matched an enum member exactly, via rz_type_db_enum_member_by_val(). A
value that is the bitwise OR of several flag members -- e.g. the access(2) mode
R_OK|W_OK == 6 from the issue -- matched no single member and was left as a raw
number.

replace_enum_hint() in rz_parse now falls back to rz_type_db_enum_get_bitfield()
when there is no exact member, so the value is rendered as the OR of the
matching members, e.g. "access_def.W_OK | access_def.R_OK".

rz_type_db_enum_get_bitfield() is reworked along the way: it was unused and
buggy (capped at 32 bits, reused a stale match for bits without a member, and
emitted a "0x.. : " debug prefix). It now walks all 64 bits, returns the
matching members qualified with the enum name and joined by " | ", and returns
NULL when the value is 0, the type is not an enum, or any set bit has no member
(so a value that is not cleanly a combination of flags stays a number).

Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2026-06-02 04:22:25 +08:00
..
cpus Support Siemens/Infineon C16x microcontroller (#6321) 2026-05-12 21:17:37 +08:00
esil Move ESIL into its own namespace (#6199) 2026-04-11 16:26:01 +08:00
il Move ESIL into its own namespace (#6199) 2026-04-11 16:26:01 +08:00
isa Update Capstone and add M68k ColdFire support (#6399) 2026-05-31 16:15:56 +08:00
isa_gnu librz/arch: rewrite the RISC-V support to use Capstone (#5482) 2026-02-17 03:35:37 +08:00
opcodes Support Siemens/Infineon C16x microcontroller (#6321) 2026-05-12 21:17:37 +08:00
p Update Capstone and add M68k ColdFire support (#6399) 2026-05-31 16:15:56 +08:00
p_gnu Inline rz_list_iter_set_data() and shorten it to rz_list_set_val() (#6131) 2026-04-02 06:04:54 +08:00
platforms Merge rz_asm and rz_analysis into one library but keep deprecated apis. 2024-03-07 18:38:49 +08:00
types types: fix stubs and add missing Windows types (#6421) 2026-05-29 16:14:16 +08:00
acode.c refactor: remove RzAsm struct from the public APIs (#6089) 2026-03-26 01:57:42 +08:00
analysis.c librz/core: implement ROP/JOP/COP gadget cache (#6328) 2026-05-24 21:48:42 +08:00
analysis_private.h librz/core: implement ROP/JOP/COP gadget cache (#6328) 2026-05-24 21:48:42 +08:00
aop.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
arch.c Move parse into arch. (#4342) 2024-03-07 23:50:22 +08:00
asm.c librz/debug: native debugger plugin for RISC-V (#5966) 2026-04-26 16:28:07 +08:00
asm_private.h refactor: remove RzAsm struct from the public APIs (#6089) 2026-03-26 01:57:42 +08:00
binutils_as.c refactor: remove RzAsm struct from the public APIs (#6089) 2026-03-26 01:57:42 +08:00
binutils_as.h refactor: remove RzAsm struct from the public APIs (#6089) 2026-03-26 01:57:42 +08:00
block.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
cc.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
class.c librz/arch: fix some memory leaks (#6240) 2026-04-17 00:09:52 +08:00
cond.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
cycles.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
data.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
deprecated_arch_helper.h Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
dwarf_process.c librz/type: support C bitfield members in structs and unions (#1240, #314) (#6439) 2026-06-01 05:03:31 +08:00
fcn.c librz/type: fix struct/union and RzCallable memory leaks (#6423) 2026-05-29 23:58:34 +08:00
filter.c librz/arch: render flag-enum operands as an OR of members (#2344) (#6450) 2026-06-02 04:22:25 +08:00
function.c Fix RZ_IPI usage on public headers & fix memory leak in the ROP code. (#6171) 2026-04-08 13:37:17 +08:00
hint.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
il_trace.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
jmptbl.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
labels.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
luac_process.c Convert %ll format specifiers to PFMT64 (#6267) 2026-04-22 05:57:04 +08:00
meson.build arch/tms320: named instruction IDs (TMS320C55_INS_*) from the disassembler 2026-05-28 17:44:54 +08:00
meta.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
no_rtti.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
omf_process.c librz/arch/c166: remove unnecessary use of assert macroses (#6345) 2026-05-15 23:53:27 +08:00
op.c Fix memory leaks related to DWARF (#6245) 2026-04-17 17:33:11 +00:00
parse.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
parse_helper.c Move parse into arch. (#4342) 2024-03-07 23:50:22 +08:00
parse_helper.h Move parse into arch. (#4342) 2024-03-07 23:50:22 +08:00
pdb_process.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
platform_profile.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
platform_target_index.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
reflines.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
rtti.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
rtti_itanium.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
rtti_msvc.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
serialize_analysis.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
similarity.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
swift_rtti.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
switch.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
types.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
value.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
var.c Improve mips args & prelude detection (#6320) 2026-05-10 22:32:23 +08:00
var_global.c Convert %ll format specifiers to PFMT64 (#6267) 2026-04-22 05:57:04 +08:00
vtable.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00
xrefs.c Move RzAnalysis as private and force usage of C API (#6123) 2026-04-06 16:07:53 +00:00