diff options
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/symtab.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 70ae976..954fb53 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2011-06-20 Tom Tromey <tromey@redhat.com> + + * symtab.c (lookup_language_this): End loop if block is NULL. + 2011-06-17 Tom Tromey <tromey@redhat.com> * valops.c (value_of_this): Use lookup_language_this. 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 |