]> granicus.if.org Git - yasm/commitdiff
* x86bc.c (x86_bc_insn_resolve): Fix loss of precision on yasm_intnum_get_int
authorPeter Johnson <peter@tortall.net>
Thu, 13 Oct 2005 07:17:15 +0000 (07:17 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 13 Oct 2005 07:17:15 +0000 (07:17 -0000)
return value on 64-bit machines that could cause incorrect optimization.

svn path=/trunk/yasm/; revision=1280

modules/arch/x86/x86bc.c

index 83b1c30da1d9b02ffdd6b4bf42f0ea30804b12e1..b7f879f4c786b4b8161250eff0211faa80355667 100644 (file)
@@ -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.