]> granicus.if.org Git - yasm/commitdiff
* x86bc.c (x86_bc_insn_tobytes, x86_bc_jmp_tobytes): Enable signed warnings
authorPeter Johnson <peter@tortall.net>
Fri, 10 Feb 2006 04:15:56 +0000 (04:15 -0000)
committerPeter Johnson <peter@tortall.net>
Fri, 10 Feb 2006 04:15:56 +0000 (04:15 -0000)
for signed immediates, jump values.

Note: [1369] actually matches this commit, not [1368].

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

modules/arch/x86/x86bc.c

index d9c6da3b6a60291bf2957e2822c1258fd11ec3a5..5e55ae07b3ecd0071341b2b03964def78d91a8de 100644 (file)
@@ -1022,7 +1022,8 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d,
     /* Immediate (if required) */
     if (imm && imm->val) {
        if (output_expr(&imm->val, *bufp, imm->len, (size_t)(imm->len*8), 0,
-                       (unsigned long)(*bufp-bufp_orig), bc, 0, 1, d))
+                       (unsigned long)(*bufp-bufp_orig), bc, 0,
+                       imm->sign?-1:1, d))
            return 1;
        *bufp += imm->len;
     }
@@ -1069,7 +1070,7 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d,
                                                    YASM_EXPR_WRT, wrt,
                                                    bc->line);
            if (output_expr(&jmp->target, *bufp, 1, 8, 0,
-                           (unsigned long)(*bufp-bufp_orig), bc, 1, 1, d))
+                           (unsigned long)(*bufp-bufp_orig), bc, 1, -1, d))
                return 1;
            *bufp += 1;
            break;
@@ -1095,7 +1096,7 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d,
                                                    bc->line);
            i = (opersize == 16) ? 2 : 4;
            if (output_expr(&jmp->target, *bufp, i, i*8, 0,
-                           (unsigned long)(*bufp-bufp_orig), bc, 1, 1, d))
+                           (unsigned long)(*bufp-bufp_orig), bc, 1, -1, d))
                return 1;
            *bufp += i;
            break;