This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Use of uninitialized data in gcc/genattrtab.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: Use of uninitialized data in gcc/genattrtab.c
- From: Andris Pavenis <andris at stargate dot astr dot lu dot lv>
- Date: Thu, 23 Mar 2000 18:41:59 +0200
Procedure find_attr() in genattrtab.c does not initialize all bit fields
in structure attr in current CVS version of gcc-2.96. It's usually remains
unnoticed in Linux as they seems to be practically always 0, but for
DJGPP I got random values there (after that insn-attrtab.c mostly didn't compile
at all). Perhaps only unsigned_p is critical, but I think it's best to zero also
func_units_p and blockage_p to avoid randomly changing comments
Andris
--- genattrtab.c~1 Wed Mar 8 03:04:42 2000
+++ genattrtab.c Thu Mar 23 18:40:38 2000
@@ -5746,7 +5746,8 @@
attr = (struct attr_desc *) oballoc (sizeof (struct attr_desc));
attr->name = attr_string (name, strlen (name));
attr->first_value = attr->default_val = NULL;
- attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0;
+ attr->is_numeric = attr->negative_ok = unsigned_p = attr->is_const = attr->is_special
+ = func_units_p = blockage_p = 0;
attr->next = attrs[index];
attrs[index] = attr;