aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-12-14 20:24:59 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-12-14 20:24:59 +0000
commit6475f2fe1c3e31535c8feeb68ac978eb5e37d664 (patch)
treeb80094bb2c9dbf7ef4f9dd95b4a65fb5b135aad1 /gdb
parentd6a0f6e0c71bc2217ddc2d8bc51331f4f713c43d (diff)
downloadgdb-6475f2fe1c3e31535c8feeb68ac978eb5e37d664.zip
gdb-6475f2fe1c3e31535c8feeb68ac978eb5e37d664.tar.gz
gdb-6475f2fe1c3e31535c8feeb68ac978eb5e37d664.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ada-lang.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 951e9fd..1db3894 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-14 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (add_nonlocal_symbols): Initialize data to
+ all zeros. Remove setting of data.arg_sym to NULL.
+
2011-12-14 Pedro Alves <pedro@codesourcery.com>
PR threads/10729
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)
{