summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r--src/arch/instruction.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index 4079e82..cd9ccff 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -35,6 +35,7 @@
#include "instruction-int.h"
#include "storage.h"
#include "../core/logs.h"
+#include "../core/processors.h"
#include "../glibext/gbinarycursor.h"
#include "../glibext/linegen-int.h"
#include "../gtkext/gtkblockdisplay.h"
@@ -666,9 +667,19 @@ void g_arch_instruction_unlock_operands(GArchInstruction *instr)
void g_arch_instruction_attach_extra_operand(GArchInstruction *instr, GArchOperand *operand)
{
+ GSingletonFactory *factory; /* Unise à instances uniques */
+ GArchOperand *singleton; /* Instance retenue */
+
+ factory = get_operands_factory();
+
+ singleton = G_ARCH_OPERAND(g_singleton_factory_get_instance(factory, G_SINGLETON_CANDIDATE(operand)));
+
+ g_object_unref(G_OBJECT(operand));
+ g_object_unref(G_OBJECT(factory));
+
g_arch_instruction_lock_operands(instr);
- add_item_to_flat_array(&instr->operands, &operand, sizeof(GArchOperand *));
+ add_item_to_flat_array(&instr->operands, &singleton, sizeof(GArchOperand *));
g_arch_instruction_unlock_operands(instr);