summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-06-18 18:44:55 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-06-18 18:44:55 (GMT)
commitc3c4660ca77e771d3a34a7e9029d02588e1ecd92 (patch)
treeb85b0cd387ffe0ccb2a2a6c305d77cff90404dab
parentb852df467e965716505ca2023d57016bf0015c58 (diff)
Fixed various bugs in ARMv7 operand decoding helpers.
-rw-r--r--plugins/arm/v7/helpers.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/arm/v7/helpers.h b/plugins/arm/v7/helpers.h
index 29ba021..4f9a8f9 100644
--- a/plugins/arm/v7/helpers.h
+++ b/plugins/arm/v7/helpers.h
@@ -330,9 +330,11 @@
#define NextDoubleWordVector(ref, n) \
({ \
GArchOperand *__result; \
- uint8_t __idx; \
GArchRegister *__reg; \
- __idx = g_arm_register_get_index(G_ARM_REGISTER(ref)); \
+ uint8_t __idx; \
+ __reg = g_register_operand_get_register(G_REGISTER_OPERAND(ref)); \
+ __idx = g_arm_register_get_index(G_ARM_REGISTER(__reg)); \
+ g_object_unref(G_OBJECT(__reg)); \
__reg = g_armv7_simd_register_new(SRM_DOUBLE_WORD, __idx + n); \
if (__reg == NULL) \
__result = NULL; \
@@ -358,9 +360,11 @@
#define NextSingleWordVector(prev) \
({ \
GArchOperand *__result; \
- uint8_t __idx; \
GArchRegister *__reg; \
- __idx = g_arm_register_get_index(G_ARM_REGISTER(prev)); \
+ uint8_t __idx; \
+ __reg = g_register_operand_get_register(G_REGISTER_OPERAND(prev)); \
+ __idx = g_arm_register_get_index(G_ARM_REGISTER(__reg)); \
+ g_object_unref(G_OBJECT(__reg)); \
__reg = g_armv7_simd_register_new(SRM_SINGLE_WORD, __idx + 1); \
if (__reg == NULL) \
__result = NULL; \
@@ -413,7 +417,7 @@
if (__result != NULL) \
{ \
__pc = G_ARMV7_REGISTER(g_armv7_basic_register_new(15)); \
- __list = G_ARMV7_REGLIST_OPERAND(result); \
+ __list = G_ARMV7_REGLIST_OPERAND(__result); \
if (g_armv7_reglist_operand_has_register(__list, __pc)) \
{ \
g_object_unref(G_OBJECT(__result)); \
@@ -434,7 +438,7 @@
if (__result != NULL) \
{ \
__pc = G_ARMV7_REGISTER(g_armv7_basic_register_new(15)); \
- __list = G_ARMV7_REGLIST_OPERAND(result); \
+ __list = G_ARMV7_REGLIST_OPERAND(__result); \
if (!g_armv7_reglist_operand_has_register(__list, __pc)) \
{ \
g_object_unref(G_OBJECT(__result)); \