diff options
author | Tom Tromey <tromey@redhat.com> | 2011-06-20 17:53:33 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-06-20 17:53:33 +0000 |
commit | 03de682319d5a8d18f2121056ea75aeb37b39b21 (patch) | |
tree | 84189be44cb5e2d314579ac626bb74bb771d8818 | |
parent | 185e39cdbd13b1af19cc47032825e611c54c54f4 (diff) | |
download | gdb-03de682319d5a8d18f2121056ea75aeb37b39b21.zip gdb-03de682319d5a8d18f2121056ea75aeb37b39b21.tar.gz gdb-03de682319d5a8d18f2121056ea75aeb37b39b21.tar.bz2 |
* symtab.c (lookup_language_this): End loop if block is NULL.
-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 |