aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2002-12-17 18:34:06 +0000
committerDavid Carlton <carlton@bactrian.org>2002-12-17 18:34:06 +0000
commit38d49aff686abd9a37407a26f4c6f0a22af7edf4 (patch)
tree5e24db78433a294c620cd9c2ccd6e29c9d5d5dc8 /gdb/symtab.c
parent30f7db39bd8169c551fd7efcf91b682292013db5 (diff)
downloadgdb-38d49aff686abd9a37407a26f4c6f0a22af7edf4.zip
gdb-38d49aff686abd9a37407a26f4c6f0a22af7edf4.tar.gz
gdb-38d49aff686abd9a37407a26f4c6f0a22af7edf4.tar.bz2
2002-12-17 David Carlton <carlton@math.stanford.edu>
* symtab.c (lookup_partial_symbol): Don't search past the end of the partial symbols.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index d7a0b63..badda47 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1300,7 +1300,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global,
{
struct partial_symbol *temp;
struct partial_symbol **start, **psym;
- struct partial_symbol **top, **bottom, **center;
+ struct partial_symbol **top, **real_top, **bottom, **center;
int length = (global ? pst->n_global_syms : pst->n_static_syms);
int do_linear_search = 1;
@@ -1323,6 +1323,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global,
bottom = start;
top = start + length - 1;
+ real_top = top;
while (top > bottom)
{
center = bottom + (top - bottom) / 2;
@@ -1348,7 +1349,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global,
/* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so
we don't have to force a linear search on C++. Probably holds true
for JAVA as well, no way to check.*/
- while (SYMBOL_MATCHES_NAME (*top,name))
+ while (top <= real_top && SYMBOL_MATCHES_NAME (*top,name))
{
if (SYMBOL_NAMESPACE (*top) == namespace)
{