PATCH: Use of uninitialized data in gcc/genattrtab.c

Andris Pavenis andris@stargate.astr.lu.lv
Thu Mar 23 08:59:00 GMT 2000


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;
 


More information about the Gcc-patches mailing list