summaryrefslogtreecommitdiff
path: root/src/arch/operands/register.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/operands/register.c')
-rw-r--r--src/arch/operands/register.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/arch/operands/register.c b/src/arch/operands/register.c
index d755dbb..81608a3 100644
--- a/src/arch/operands/register.c
+++ b/src/arch/operands/register.c
@@ -121,7 +121,8 @@ static void g_register_operand_class_init(GRegisterOperandClass *klass)
static void g_register_operand_init(GRegisterOperand *operand)
{
operand->reg = NULL;
- operand->is_written = false;
+
+ INIT_REG_OP_EXTRA(operand);
}
@@ -250,7 +251,15 @@ GArchRegister *g_register_operand_get_register(const GRegisterOperand *operand)
void g_register_operand_mark_as_written(GRegisterOperand *operand)
{
- operand->is_written = true;
+ regop_obj_extra *extra; /* Données insérées à modifier */
+
+ extra = GET_REG_OP_EXTRA(operand);
+
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
+
+ extra->is_written = true;
+
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
}
@@ -269,7 +278,18 @@ void g_register_operand_mark_as_written(GRegisterOperand *operand)
bool g_register_operand_is_written(const GRegisterOperand *operand)
{
- return operand->is_written;
+ bool result; /* Statut à retourner */
+ regop_obj_extra *extra; /* Données insérées à modifier */
+
+ extra = GET_REG_OP_EXTRA(operand);
+
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
+
+ result = extra->is_written;
+
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
+
+ return result;
}