summaryrefslogtreecommitdiff
path: root/src/arch/operands/immediate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/operands/immediate.c')
-rw-r--r--src/arch/operands/immediate.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/arch/operands/immediate.c b/src/arch/operands/immediate.c
index cb39fce..6e6925c 100644
--- a/src/arch/operands/immediate.c
+++ b/src/arch/operands/immediate.c
@@ -155,6 +155,9 @@ static void g_imm_operand_print(const GImmOperand *, GBufferLine *);
/* Construit un petit résumé concis de l'opérande. */
static char *g_imm_operand_build_tooltip(const GImmOperand *, const GLoadedBinary *);
+/* Fournit l'empreinte d'un candidat à une centralisation. */
+static guint g_arch_operand_hash(const GImmOperand *);
+
/* Charge un opérande depuis une mémoire tampon. */
static bool g_imm_operand_unserialize(GImmOperand *, GAsmStorage *, GBinFormat *, packed_buffer_t *);
@@ -259,6 +262,8 @@ static void g_imm_operand_class_init(GImmOperandClass *klass)
operand->print = (operand_print_fc)g_imm_operand_print;
operand->build_tooltip = (operand_build_tooltip_fc)g_imm_operand_build_tooltip;
+ operand->hash = (operand_hash_fc)g_arch_operand_hash;
+
operand->unserialize = (unserialize_operand_fc)g_imm_operand_unserialize;
operand->serialize = (serialize_operand_fc)g_imm_operand_serialize;
@@ -1573,6 +1578,30 @@ void g_imm_operand_as_uleb128(const GImmOperand *operand, uleb128_t *val)
/******************************************************************************
* *
+* Paramètres : operand = objet dont l'instance se veut unique. *
+* *
+* Description : Fournit l'empreinte d'un candidat à une centralisation. *
+* *
+* Retour : Empreinte de l'élément représenté. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static guint g_arch_operand_hash(const GImmOperand *operand)
+{
+ guint result; /* Valeur à retourner */
+
+ result = (operand->raw & 0xffffffff);
+ result ^= (operand->raw >> 32);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : operand = opérande d'assemblage à constituer. *
* storage = mécanisme de sauvegarde à manipuler. *
* format = format binaire chargé associé à l'architecture. *