[gdb/go] 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)
commit4c4d769ab7b01dab8ff8c66209f992de98095a00
treea9bc6cbd228f0b0a3a6dc1c43ef5d467da7ff933
parenta2c0d041fdbf9d661099e31629c96cdd666e8b83
[gdb/go] 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 go, take the conservative approach and keep
behaviour for decimals unchanged.

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