diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-03-19 07:26:53 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-03-19 07:26:53 (GMT) |
commit | 10ce277a45469fa194e0d5fa2f0ca531f1830191 (patch) | |
tree | 7745c62439282387df859ab2c267aba7c24b5efa | |
parent | 4cef477cbdfd61a28ed6531d1e91d5a330a67704 (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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/arch/raw.c | 7 |
2 files changed, 11 insertions, 1 deletions
@@ -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)]); |