From 03de682319d5a8d18f2121056ea75aeb37b39b21 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 20 Jun 2011 17:53:33 +0000 Subject: * symtab.c (lookup_language_this): End loop if block is NULL. --- gdb/symtab.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gdb/symtab.c') 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 -- cgit v1.1