diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-09-29 22:32:52 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-09-29 22:32:52 +0000 |
commit | bceffbf360f8a475b17761c996966bae1467b311 (patch) | |
tree | 72b94e27014548b53ccaec9b6666f4bf1b15582c /gdb/gnu-v3-abi.c | |
parent | abc72ce4c676be2f368fa0ace766ed29cd444020 (diff) | |
download | gdb-bceffbf360f8a475b17761c996966bae1467b311.zip gdb-bceffbf360f8a475b17761c996966bae1467b311.tar.gz gdb-bceffbf360f8a475b17761c996966bae1467b311.tar.bz2 |
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.
Diffstat (limited to 'gdb/gnu-v3-abi.c')
-rw-r--r-- | gdb/gnu-v3-abi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index f9d4f49..b1ddf02 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -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; |