x86arch.c, x86id.c: Explicitly cast to unsigned char.

stabs-dbgfmt.c: Check for overflow, cast to unsigned short.

svn path=/trunk/yasm/; revision=1729
0.6.0
Peter Johnson 18 years ago
parent f3300688d0
commit 5ca9f09d81
  1. 4
      modules/arch/x86/x86arch.c
  2. 2
      modules/arch/x86/x86id.c
  3. 9
      modules/dbgfmts/stabs/stabs-dbgfmt.c

@ -109,9 +109,9 @@ x86_set_var(yasm_arch *arch, const char *var, unsigned long val)
{
yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch;
if (yasm__strcasecmp(var, "mode_bits") == 0)
arch_x86->mode_bits = val;
arch_x86->mode_bits = (unsigned char)val;
else if (yasm__strcasecmp(var, "force_strict") == 0)
arch_x86->force_strict = val;
arch_x86->force_strict = (unsigned char)val;
else
return 1;
return 0;

@ -2998,7 +2998,7 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc,
if (num_segregs > 1)
yasm_warn_set(YASM_WARN_GENERAL,
N_("multiple segment overrides, using leftmost"));
insn->special_prefix = segregs[num_segregs-1]>>8;
insn->special_prefix = (unsigned char)(segregs[num_segregs-1]>>8);
} else if (num_segregs > 0)
yasm_internal_error(N_("unhandled segment prefix"));

@ -372,8 +372,6 @@ stabs_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns)
}
}
/* initial pseudo-stab */
stab = yasm_xmalloc(sizeof(stabs_stab));
dbgbc = yasm_bc_create_common(&stabs_bc_stab_callback, stab, 0);
@ -407,7 +405,12 @@ stabs_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns)
stab->bcstr = filebc;
stab->type = N_UNDF;
stab->other = 0;
stab->desc = info.stabcount;
if (info.stabcount > 0xffff) {
yasm_warn_set(YASM_WARN_GENERAL, N_("over 65535 stabs"));
yasm_errwarn_propagate(errwarns, 0);
stab->desc = 0xffff;
} else
stab->desc = (unsigned short)info.stabcount;
}
static int

Loading…
Cancel
Save