[gdb/pascal] Fix literal truncation
authorTom de Vries <tdevries@suse.de>
Sat, 4 Jun 2022 11:17:33 +0000 (13:17 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 4 Jun 2022 11:17:33 +0000 (13:17 +0200)
commit7af9baa9faead8155e4459104c30cb1b6a15180e
treef374af83c99ae1de201ea30ac3416e4adf605a72
parent4c4d769ab7b01dab8ff8c66209f992de98095a00
[gdb/pascal] Fix literal truncation

Make sure we error out on overflow instead of truncating in all cases.

The current implementation of parse_number contains a comment about PR16377,
but that's related to C-like languages.  In absence of information of whether
the same fix is needed for pascal, take the conservative approach and keep
behaviour for decimals unchanged.

Tested on x86_64-linux, with a build with --enable-targets=all.
gdb/p-exp.y
gdb/testsuite/gdb.base/parse_number.exp