From 6475f2fe1c3e31535c8feeb68ac978eb5e37d664 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Wed, 14 Dec 2011 20:24:59 +0000 Subject: fix uninitialized field in ada-lang.c (struct match_data) Field found_sym in add_nonlocal_symbols's struct match_data is used uninitialized. Rather than adding the initialization of this field (to zero), we set the entire structure to zero first, and then set the fields that need to be initialized to non-zero next. gdb/ChangeLog: * ada-lang.c (add_nonlocal_symbols): Initialize data to all zeros. Remove setting of data.arg_sym to NULL. --- gdb/ada-lang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/ada-lang.c') diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 33d7253..1befc43 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -4922,8 +4922,8 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name, struct objfile *objfile; struct match_data data; + memset (&data, 0, sizeof data); data.obstackp = obstackp; - data.arg_sym = NULL; ALL_OBJFILES (objfile) { -- cgit v1.1