summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-28 19:40:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-28 19:40:19 (GMT)
commit0f0cb560006c0ef5eb690f89c4ce720936c9d6f6 (patch)
tree09a09248b4da91cbebae8609249d02f3fbef1ef3 /src/arch/instruction.c
parent3e6c0fb01710f61e8dc9383de6be4db1188b3ee6 (diff)
Stored instruction hooks in the data section rather than in the heap.
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r--src/arch/instruction.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index 8264f5b..4c0fdb9 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -281,11 +281,9 @@ ArchInstrFlag g_arch_instruction_get_flags(const GArchInstruction *instr)
* *
******************************************************************************/
-void g_arch_instruction_set_hook(GArchInstruction *instr, InstrProcessHook type, instr_hook_fc hook)
+void g_arch_instruction_set_hooks(GArchInstruction *instr, const instr_hook_fc hooks[IPH_COUNT])
{
- assert(type < IPH_COUNT);
-
- instr->hooks[type] = hook;
+ instr->hooks = hooks;
}
@@ -310,7 +308,7 @@ void g_arch_instruction_call_hook(GArchInstruction *instr, InstrProcessHook type
{
assert(type < IPH_COUNT);
- if (instr->hooks[type] != NULL)
+ if (instr->hooks != NULL && instr->hooks[type] != NULL)
instr->hooks[type](instr, proc, context, format);
}