From: Peter Johnson Date: Thu, 13 Oct 2005 07:17:15 +0000 (-0000) Subject: * x86bc.c (x86_bc_insn_resolve): Fix loss of precision on yasm_intnum_get_int X-Git-Tag: v0.5.0rc1~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5a6599d88708efa9509b975671e5bdff9a735a4;p=yasm * x86bc.c (x86_bc_insn_resolve): Fix loss of precision on yasm_intnum_get_int return value on 64-bit machines that could cause incorrect optimization. svn path=/trunk/yasm/; revision=1280 --- diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 83b1c30d..b7f879f4 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -596,7 +596,7 @@ x86_bc_insn_resolve(yasm_bytecode *bc, int save, if (insn->postop == X86_POSTOP_SIGNEXT_IMM8 && temp && (num = yasm_expr_get_intnum(&temp, calc_bc_dist))) { if (num) { - int val = yasm_intnum_get_int(num); + long val = yasm_intnum_get_int(num); if (val >= -128 && val <= 127) { /* We can use the sign-extended byte form: shorten * the immediate length to 1.