diff options
author | Tom Tromey <tromey@adacore.com> | 2022-04-08 10:11:58 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-04-12 12:59:28 -0600 |
commit | 36baf73637c4bd7fdaa9c6318c4c8071d82ac616 (patch) | |
tree | 898bdcc4c922e7b043af8fdcb897f810ce59bff3 /gdb/ada-lex.l | |
parent | a8b7a1391135b63de73c1bf0e0a2f8f5dc8c6ba6 (diff) | |
download | gdb-36baf73637c4bd7fdaa9c6318c4c8071d82ac616.zip gdb-36baf73637c4bd7fdaa9c6318c4c8071d82ac616.tar.gz gdb-36baf73637c4bd7fdaa9c6318c4c8071d82ac616.tar.bz2 |
Fix bug in Ada number lexing
On irc, Pedro pointed out that Ada couldn't properly handle
0xffffffffffffffff. This used to work, but is a regression due to
some patches I wrote in the Ada lexer. This patch fixes the bug.
Diffstat (limited to 'gdb/ada-lex.l')
-rw-r--r-- | gdb/ada-lex.l | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l index 3980889..33a08ea 100644 --- a/gdb/ada-lex.l +++ b/gdb/ada-lex.l @@ -462,11 +462,11 @@ processInt (struct parser_state *par_state, const char *base0, return FLOAT; } - gdb_mpz maxval (ULONGEST_MAX / base); + gdb_mpz maxval (ULONGEST_MAX); if (mpz_cmp (result.val, maxval.val) > 0) error (_("Integer literal out of range")); - LONGEST value = result.as_integer<LONGEST> (); + ULONGEST value = result.as_integer<ULONGEST> (); if ((value >> (gdbarch_int_bit (par_state->gdbarch ())-1)) == 0) yylval.typed_val.type = type_int (par_state); else if ((value >> (gdbarch_long_bit (par_state->gdbarch ())-1)) == 0) |