aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-03-28 11:53:59 +0100
committerJan Beulich <jbeulich@suse.com>2024-03-28 11:53:59 +0100
commit226749d5a6ff0d5c607d6428d6c81e1e7e7a994b (patch)
tree88ac6a3127f548cdf25db9b984e1316e4c0ac7ca /gas/read.c
parent5fc0b1f79fba21cbaf31c197d279773a00a63ef0 (diff)
downloadgdb-226749d5a6ff0d5c607d6428d6c81e1e7e7a994b.zip
gdb-226749d5a6ff0d5c607d6428d6c81e1e7e7a994b.tar.gz
gdb-226749d5a6ff0d5c607d6428d6c81e1e7e7a994b.tar.bz2
gas: sanitize FB- and dollar-label uses
I don't view it as sensible to be more lax when it comes to references to (uses of) such labels compared to their definition: The latter has been limited to decimal numerics, while the former permitted any radix. Beyond that leading zeroes on such labels aren't helpful either. Imo labels and their use sites would better match literally, to avoid confusion. As it turns out, one z80 testcase actually had such an odd use of labels where definition and use don't match in spelling. That testcase is being adjusted accordingly. While there also adjust a comment on a local variable in integer_constant().
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gas/read.c b/gas/read.c
index 8c1e399..61a3f17 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1269,6 +1269,10 @@ read_a_source_file (const char *name)
while (ISDIGIT (*input_line_pointer))
{
const long digit = *input_line_pointer - '0';
+
+ /* Don't accept labels which look like octal numbers. */
+ if (temp == 0)
+ break;
if (temp > (INT_MAX - digit) / 10)
{
as_bad (_("local label too large near %s"), backup);