* cast loss in final.c
@ 1998-03-16 20:44 Joern Rennecke
0 siblings, 0 replies; only message in thread
From: Joern Rennecke @ 1998-03-16 20:44 UTC (permalink / raw)
To: egcs
I have just seen the apended change with cvs. I think it is wrong.
If the operand number cannot be represented as an integer on the host,
this can result in a negative value for c. By removing the cast to unsigned,
such an error condition will will not be checked for, but result in
a memory access to some peudo-random location.
Thu Mar 12 08:37:02 1998 Manfred Hollstein <manfred@s-direktnet.de>
...
* final.c (output_asm_insn): Don't cast insn_noperands to unsigned.
Index: final.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/final.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -p -r1.26 -r1.27
*** final.c 1998/03/11 07:12:25 1.26
--- final.c 1998/03/12 00:02:42 1.27
*************** output_asm_insn (template, operands)
*** 3244,3250 ****
if (! (*p >= '0' && *p <= '9'))
output_operand_lossage ("operand number missing after %-letter");
! else if (this_is_asm_operands && c >= (unsigned) insn_noperands)
output_operand_lossage ("operand number out of range");
else if (letter == 'l')
output_asm_label (operands[c]);
--- 3244,3250 ----
if (! (*p >= '0' && *p <= '9'))
output_operand_lossage ("operand number missing after %-letter");
! else if (this_is_asm_operands && c >= insn_noperands)
output_operand_lossage ("operand number out of range");
else if (letter == 'l')
output_asm_label (operands[c]);
*************** output_asm_insn (template, operands)
*** 3277,3283 ****
else if (*p >= '0' && *p <= '9')
{
c = atoi (p);
! if (this_is_asm_operands && c >= (unsigned) insn_noperands)
output_operand_lossage ("operand number out of range");
else
output_operand (operands[c], 0);
--- 3277,3283 ----
else if (*p >= '0' && *p <= '9')
{
c = atoi (p);
! if (this_is_asm_operands && c >= insn_noperands)
output_operand_lossage ("operand number out of range");
else
output_operand (operands[c], 0);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-03-16 20:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-16 20:44 cast loss in final.c Joern Rennecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).