This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
bug in gas/read.c:s_space ?
- To: binutils at sourceware dot cygnus dot com
- Subject: bug in gas/read.c:s_space ?
- From: Geoff Berry <geoffb at bops dot com>
- Date: Mon, 3 Apr 2000 18:35:13 -0400
It seems to me that the error checking in the included snippet of
s_space() is incorrect since the error is only reported if exp (which
is the size expression) is non-constant. This leads to weird behaivor
if someone mistakenly writes
.space 0x100, a
I would send a patch, but I don't really understand the intention of
the code in the else branch.
From gas/read.c:2870
if (val.X_op != O_constant
|| val.X_add_number < - 0x80
|| val.X_add_number > 0xff
|| (mult != 0 && mult != 1 && val.X_add_number != 0))
{
if (exp.X_op != O_constant)
as_bad ("Unsupported variable size or fill value");
else
{
offsetT i;
if (mult == 0)
mult = 1;
bytes = mult * exp.X_add_number;
for (i = 0; i < exp.X_add_number; i++)
emit_expr (&val, mult);
}
}
else
{
...
--
Geoff Berry