From: Peter Johnson Date: Fri, 10 Feb 2006 04:15:56 +0000 (-0000) Subject: * x86bc.c (x86_bc_insn_tobytes, x86_bc_jmp_tobytes): Enable signed warnings X-Git-Tag: v0.5.0rc1~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29b0319135760d52c7509bb71111f1c5ae0bd33e;p=yasm * x86bc.c (x86_bc_insn_tobytes, x86_bc_jmp_tobytes): Enable signed warnings for signed immediates, jump values. Note: [1369] actually matches this commit, not [1368]. svn path=/trunk/yasm/; revision=1370 --- diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index d9c6da3b..5e55ae07 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -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;