diff options
author | Hannes Domani <ssbssa@yahoo.de> | 2023-12-25 19:05:55 +0100 |
---|---|---|
committer | Hannes Domani <ssbssa@yahoo.de> | 2024-03-20 16:40:30 +0100 |
commit | 105470cd79f6d8c62b9156ce45e992895b01b13b (patch) | |
tree | 694593af6a4c511c063e29fe61ff7a24477d2a3e /libiberty/ffs.c | |
parent | 53ff349e553fa9fc446a8711e37fd252282b088b (diff) | |
download | binutils-105470cd79f6d8c62b9156ce45e992895b01b13b.zip binutils-105470cd79f6d8c62b9156ce45e992895b01b13b.tar.gz binutils-105470cd79f6d8c62b9156ce45e992895b01b13b.tar.bz2 |
Fix comparison of array types
Currently it's not possible to call functions if an argument is a
pointer to an array:
```
(gdb) l f
1 int f (int (*x)[2])
2 {
3 return x[0][1];
4 }
5
6 int main()
7 {
8 int a[2][2] = {{0, 1}, {2, 3}};
9 return f (a);
10 }
(gdb) p f(a)
Cannot resolve function f to any overloaded instance
```
This happens because types_equal doesn't handle array types, so the
function is never even considered as a possibility.
With array type handling added, by comparing element types and array
bounds, the same works:
```
(gdb) p f(a)
$1 = 1
```
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=15398
Co-Authored-By: Keith Seitz <keiths@redhat.com>
Reviewed-By: Guinevere Larsen <blarsen@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'libiberty/ffs.c')
0 files changed, 0 insertions, 0 deletions