diff options
author | George Barrett <bob@bob131.so> | 2021-07-30 01:12:18 +1000 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-07-29 12:55:16 -0400 |
commit | b5b591a865b3021453a47c612ece5e7574b47d04 (patch) | |
tree | fd2005dd4656f5414fc395b1fa64081e1ff36933 /bfd/elfnn-riscv.c | |
parent | c3c1e6459f89167fc01de9376c6b34574d710278 (diff) | |
download | gdb-b5b591a865b3021453a47c612ece5e7574b47d04.zip gdb-b5b591a865b3021453a47c612ece5e7574b47d04.tar.gz gdb-b5b591a865b3021453a47c612ece5e7574b47d04.tar.bz2 |
guile: fix make-value with pointer type
Calling the `make-value' procedure with an integer value and a pointer
type for the #:type argument triggers a failed assertion in
`get_unsigned_type_max', as that function doesn't consider pointers to
be an unsigned type. This commit fixes the issue by adding a separate
code path for pointers.
As previously suggested, range checking is done using a new helper
function in gdbtypes.
gdb/ChangeLog:
2021-07-30 George Barrett <bob@bob131.so>
* gdbtypes.h (get_pointer_type_max): Add declaration.
* gdbtypes.c (get_pointer_type_max): Add definition for new
helper function.
* guile/scm-math.c (vlscm_convert_typed_number): Add code path
for handling conversions to pointer types without failing an
assert.
gdb/testsuite/ChangeLog:
2021-07-30 George Barrett <bob@bob131.so>
* gdb.guile/scm-math.exp (test_value_numeric_ops): Add test
for creating pointers with make-value.
(test_make_pointer_value, test_pointer_numeric_range): Add
test procedures containing checks for integer-to-pointer
validation.
Change-Id: I9994dd1c848840a3d995f745e6d72867732049f0
Diffstat (limited to 'bfd/elfnn-riscv.c')
0 files changed, 0 insertions, 0 deletions