diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-01-29 10:30:20 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-01-29 10:30:20 +0000 |
commit | 80b23b6aeb1ae33fd4e4365b9a075c18fd1407f7 (patch) | |
tree | 25c91c5ba1eb71bd08ecc4685c6e3e8415858d82 /gdb/valops.c | |
parent | 5240d94db3d3ad8f1fcd6b603ab01da442e7358e (diff) | |
download | gdb-80b23b6aeb1ae33fd4e4365b9a075c18fd1407f7.zip gdb-80b23b6aeb1ae33fd4e4365b9a075c18fd1407f7.tar.gz gdb-80b23b6aeb1ae33fd4e4365b9a075c18fd1407f7.tar.bz2 |
gdb/
Fix crash.
* valops.c (compare_parameters): Verify TYPE_NFIELDS before
touching TYPE_FIELD_ARTIFICIAL.
gdb/testsuite/
* gdb.cp/noparam.exp: New file.
* gdb.cp/noparam.cc: New file.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 19d5238..24c2269 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3097,7 +3097,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) { int start = 0; - if (TYPE_FIELD_ARTIFICIAL (t1, 0)) + if (TYPE_NFIELDS (t1) > 0 && TYPE_FIELD_ARTIFICIAL (t1, 0)) ++start; /* If skipping artificial fields, find the first real field |