summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-03-19 07:26:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-03-19 07:26:53 (GMT)
commit10ce277a45469fa194e0d5fa2f0ca531f1830191 (patch)
tree7745c62439282387df859ab2c267aba7c24b5efa /src
parent4cef477cbdfd61a28ed6531d1e91d5a330a67704 (diff)
Fixed an invalid cast between two GLib instances in some cases.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@492 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src')
-rw-r--r--src/arch/raw.c7
1 files changed, 6 insertions, 1 deletions
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)]);