aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-06-20 17:53:33 +0000
committerTom Tromey <tromey@redhat.com>2011-06-20 17:53:33 +0000
commit03de682319d5a8d18f2121056ea75aeb37b39b21 (patch)
tree84189be44cb5e2d314579ac626bb74bb771d8818 /gdb/symtab.c
parent185e39cdbd13b1af19cc47032825e611c54c54f4 (diff)
downloadgdb-03de682319d5a8d18f2121056ea75aeb37b39b21.zip
gdb-03de682319d5a8d18f2121056ea75aeb37b39b21.tar.gz
gdb-03de682319d5a8d18f2121056ea75aeb37b39b21.tar.bz2
* symtab.c (lookup_language_this): End loop if block is NULL.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index d627636..13234f2 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1100,7 +1100,7 @@ lookup_language_this (const struct language_defn *lang,
if (lang->la_name_of_this == NULL || block == NULL)
return NULL;
- while (1)
+ while (block)
{
struct symbol *sym;
@@ -1108,9 +1108,11 @@ lookup_language_this (const struct language_defn *lang,
if (sym != NULL)
return sym;
if (BLOCK_FUNCTION (block))
- return NULL;
+ break;
block = BLOCK_SUPERBLOCK (block);
}
+
+ return NULL;
}
/* Behave like lookup_symbol except that NAME is the natural name