diff options
author | Tom de Vries <tdevries@suse.de> | 2022-06-04 13:17:33 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-06-04 13:17:33 +0200 |
commit | a2c0d041fdbf9d661099e31629c96cdd666e8b83 (patch) | |
tree | fd57bbce38c965858a10bf155ec18832f3e2d5fc /gdb/python | |
parent | 1d8c0dfae79a5183e9e3311fb867afd679bc8e84 (diff) | |
download | binutils-a2c0d041fdbf9d661099e31629c96cdd666e8b83.zip binutils-a2c0d041fdbf9d661099e31629c96cdd666e8b83.tar.gz binutils-a2c0d041fdbf9d661099e31629c96cdd666e8b83.tar.bz2 |
[gdb/fortran] Fix literal truncation
As mentioned in commit 5b758627a18 ("Make gdb.base/parse_number.exp test all
architectures"):
...
There might be a bug that 32-bit fortran truncates 64-bit values to
32-bit, given "p/x 0xffffffffffffffff" returns "0xffffffff".
...
More concretely, we have:
...
$ for arch in i386:x86-64 i386; do \
gdb -q -batch -ex "set arch $arch" -ex "set lang fortran" \
-ex "p /x 0xffffffffffffffff"; \
done
The target architecture is set to "i386:x86-64".
$1 = 0xffffffffffffffff
The target architecture is set to "i386".
$1 = 0xffffffff
...
Fix this by adding a range check in parse_number in gdb/f-exp.y.
Furthermore, make sure we error out on overflow instead of truncating in all
other cases.
Tested on x86_64-linux.
Diffstat (limited to 'gdb/python')
0 files changed, 0 insertions, 0 deletions