aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-01-29 10:30:20 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-01-29 10:30:20 +0000
commit80b23b6aeb1ae33fd4e4365b9a075c18fd1407f7 (patch)
tree25c91c5ba1eb71bd08ecc4685c6e3e8415858d82 /gdb/valops.c
parent5240d94db3d3ad8f1fcd6b603ab01da442e7358e (diff)
downloadbinutils-80b23b6aeb1ae33fd4e4365b9a075c18fd1407f7.zip
binutils-80b23b6aeb1ae33fd4e4365b9a075c18fd1407f7.tar.gz
binutils-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.c2
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