diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-05-19 11:28:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-05-19 11:28:51 (GMT) |
commit | d18e9e686615c833491b350726d56931aed7075c (patch) | |
tree | ad1ab4eaa174cc8e6b1db9218892593aa626b8fc | |
parent | c930f8b060034abefbae48ad76a9b8d1e55b1ec9 (diff) |
Fixed the loading of ARMv7 written-back registers.
-rw-r--r-- | plugins/arm/v7/helpers.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/plugins/arm/v7/helpers.h b/plugins/arm/v7/helpers.h index a863a2d..3f8d97c 100644 --- a/plugins/arm/v7/helpers.h +++ b/plugins/arm/v7/helpers.h @@ -389,26 +389,34 @@ }) -#define UncheckedWrittenBackReg(reg) \ +#define UncheckedWrittenBackReg(regop) \ ({ \ GArchOperand *__result; \ - if (reg == NULL) \ + GArchRegister *__reg; \ + if (regop == NULL) \ __result = NULL; \ else \ - __result = g_armv7_register_operand_new(G_ARMV7_REGISTER(reg)); \ + { \ + __reg = g_register_operand_get_register(G_REGISTER_OPERAND(regop)); \ + g_object_unref(G_OBJECT(regop)); \ + __result = g_armv7_register_operand_new(G_ARMV7_REGISTER(__reg)); \ + } \ __result; \ }) -#define WrittenBackReg(reg, writeback) \ +#define WrittenBackReg(regop, writeback) \ ({ \ GArchOperand *__result; \ + GArchRegister *__reg; \ GArmV7RegisterOperand *__armv7_op; \ - if (reg == NULL) \ + if (regop == NULL) \ __result = NULL; \ else \ { \ - __result = g_armv7_register_operand_new(G_ARMV7_REGISTER(reg)); \ + __reg = g_register_operand_get_register(G_REGISTER_OPERAND(regop)); \ + g_object_unref(G_OBJECT(regop)); \ + __result = g_armv7_register_operand_new(G_ARMV7_REGISTER(__reg)); \ if (__result != NULL && writeback == 1) \ { \ __armv7_op = G_ARMV7_REGISTER_OPERAND(__result); \ |