From: Elena Zannoni Date: Fri, 8 Aug 2003 14:06:26 +0000 (+0000) Subject: 2003-08-08 Elena Zannoni X-Git-Tag: gdb_6_0-2003-10-04-release~135 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62102626cf47bca8b5edca10aeced5153f5bc723;p=thirdparty%2Fbinutils-gdb.git 2003-08-08 Elena Zannoni * symtab.c (lookup_symbol_aux): Make sure that is_a_field_of_this contains something meaningful at all times. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e44fa1a7898..5655a28b0c3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-08-08 Elena Zannoni + + * symtab.c (lookup_symbol_aux): Make sure that is_a_field_of_this + contains something meaningful at all times. + 2003-08-07 Andrew Cagney * interps.h (INTERP_MI2, INTERP_MI3): Define. diff --git a/gdb/symtab.c b/gdb/symtab.c index ddf8748b7d4..48afabb7fbd 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -945,6 +945,14 @@ lookup_symbol_aux (const char *name, const char *linkage_name, { struct symbol *sym; + /* Make sure we do something sensible with is_a_field_of_this, since + the callers that set this parameter to some non-null value will + certainly use it later and expect it to be either 0 or 1. + If we don't set it, the contents of is_a_field_of_this are + undefined. */ + if (is_a_field_of_this != NULL) + *is_a_field_of_this = 0; + /* Search specified block and its superiors. Don't search STATIC_BLOCK or GLOBAL_BLOCK. */ @@ -961,7 +969,6 @@ lookup_symbol_aux (const char *name, const char *linkage_name, { struct value *v = current_language->la_value_of_this (0); - *is_a_field_of_this = 0; if (v && check_field (v, name)) { *is_a_field_of_this = 1;