mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 18:20:12 +08:00
gdb/
Fix GDB crash on inferior calls with self-referencing classes. * gnu-v3-abi.c (gnuv3_pass_by_reference): Do not call itself on static member fields. gdb/testsuite/ Fix GDB crash on inferior calls with self-referencing classes. * gdb.dwarf2/dw2-cp-infcall-ref-static.exp: New file. * gdb.dwarf2/dw2-cp-infcall-ref-static-main.c: New file. * gdb.dwarf2/dw2-cp-infcall-ref-static.S: New file.
This commit is contained in:
@ -835,9 +835,10 @@ gnuv3_pass_by_reference (struct type *type)
|
||||
by reference, so does this class. Similarly for members, which
|
||||
are constructed whenever this class is. We do not need to worry
|
||||
about recursive loops here, since we are only looking at members
|
||||
of complete class type. */
|
||||
of complete class type. Also ignore any static members. */
|
||||
for (fieldnum = 0; fieldnum < TYPE_NFIELDS (type); fieldnum++)
|
||||
if (gnuv3_pass_by_reference (TYPE_FIELD_TYPE (type, fieldnum)))
|
||||
if (! field_is_static (&TYPE_FIELD (type, fieldnum))
|
||||
&& gnuv3_pass_by_reference (TYPE_FIELD_TYPE (type, fieldnum)))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user