diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/search.c | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ec4684d..c768b4f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2003-04-22 Mark Mitchell <mark@codesourcery.com> + PR c++/10446 + * search.c (lookup_fnfields_1): Handle empty slots in the method + vector. + PR c++/10428 * decl.c (check_elaborated_type_specifier): New function, split out from ... diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 433e1ac..b557fdf 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1400,9 +1400,14 @@ lookup_fnfields_1 (tree type, tree name) n_outer_fields_searched++; #endif /* GATHER_STATISTICS */ - tmp = DECL_NAME (OVL_CURRENT (methods[i])); - - if (tmp > name) + tmp = methods[i]; + /* This slot may be empty; we allocate more slots + than we need. In that case, the entry we're + looking for is closer to the beginning of the + list. */ + if (tmp) + tmp = DECL_NAME (OVL_CURRENT (tmp)); + if (!tmp || tmp > name) hi = i; else if (tmp < name) lo = i + 1; |