diff options
author | Tom de Vries <tdevries@suse.de> | 2022-05-23 14:50:02 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-05-23 14:50:02 +0200 |
commit | 5a3cf18c2ed9593f194ea22f50ea5651532f6cfc (patch) | |
tree | 4b617189ef5761bb5f892e09774bedf49865dc52 /gdbsupport/common-gdbthread.h | |
parent | 05527d8ca1082b4607e9ddc3209691f454b3b186 (diff) | |
download | gdb-5a3cf18c2ed9593f194ea22f50ea5651532f6cfc.zip gdb-5a3cf18c2ed9593f194ea22f50ea5651532f6cfc.tar.gz gdb-5a3cf18c2ed9593f194ea22f50ea5651532f6cfc.tar.bz2 |
[gdb/exp] Fix UB in scalar_binop
When building gdb with -fsanitize=undefined, I run into:
...
$ gdb -q -batch -ex "p -(-0x7fffffffffffffff - 1)"
src/gdb/valarith.c:1385:10: runtime error: signed integer overflow: \
0 - -9223372036854775808 cannot be represented in type 'long int'
$1 = -9223372036854775808
...
Fix this by performing the substraction in scalar_binop using unsigned types.
Tested on x86_64-linux.
Diffstat (limited to 'gdbsupport/common-gdbthread.h')
0 files changed, 0 insertions, 0 deletions