summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/arch/raw.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2dcb1d2..e491d22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+15-03-19 Cyrille Bagard <nocbos@gmail.com>
+
+ * src/arch/raw.c:
+ Fix an invalid cast between two GLib instances in some cases.
+
15-03-18 Cyrille Bagard <nocbos@gmail.com>
* src/analysis/disass/area.c:
diff --git a/src/arch/raw.c b/src/arch/raw.c
index 3338613..cf990f0 100644
--- a/src/arch/raw.c
+++ b/src/arch/raw.c
@@ -31,6 +31,7 @@
#include "immediate.h"
#include "instruction-int.h"
+#include "target.h"
@@ -508,7 +509,11 @@ static void g_raw_instruction_build_keyword(const GRawInstruction *instr, AsmSyn
static char *defines[] = { "dn", "db", "dw", "dd", "dq" };
operand = g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0);
- size = g_imm_operand_get_size(G_IMM_OPERAND(operand));
+
+ if (G_IS_TARGET_OPERAND(operand))
+ size = g_target_operand_get_size(G_TARGET_OPERAND(operand));
+ else
+ size = g_imm_operand_get_size(G_IMM_OPERAND(operand));
G_ARCH_INSTRUCTION(instr)->cached_keyword = strdup(defines[MDS_RANGE(size)]);