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

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


On Thu, 23 Mar 2000, Andris Pavenis wrote:
> 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

Sorry (didn't test patch earlier). Corect patch follows

Andris

--- genattrtab.c~1	Wed Mar  8 03:04:42 2000
+++ genattrtab.c	Thu Mar 23 19:00:41 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 = attr->unsigned_p = attr->is_const = attr->is_special 
+                   = attr->func_units_p = attr->blockage_p = 0;
   attr->next = attrs[index];
   attrs[index] = attr;
 


More information about the Gcc-patches mailing list