[cfg-branch] variable tracking memory overflow

Jan Hubicka jh@suse.cz
Wed Mar 27 08:11:00 GMT 2002


Hi,
this fixes the memory overflow bug in set_location_part.  Currently
the maximal number of location is fixed to 16 that is OK for variables,
but for some purpose we track structures too and then we exceed the limit.

Josef: Can you check what really is happening?

I am commiting this to keep tree bootstrapping.

Honza

Wed Mar 27 17:00:13 CET 2002  Jan Hubicka  <jh@suse.cz>

	* var-tracking.c (set_location_part): Avoid overflow.

Index: var-tracking.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Attic/var-tracking.c,v
retrieving revision 1.1.2.1
diff -c -3 -p -r1.1.2.1 var-tracking.c
*** var-tracking.c	2002/03/25 17:12:07	1.1.2.1
--- var-tracking.c	2002/03/27 16:00:10
*************** set_location_part (decl, offset, loc, in
*** 898,903 ****
--- 898,905 ----
    if (k == var->n_location_parts)
      {
        /* Did not find the part, create new one.  */
+       if (var->n_location_parts >= MAX_LOC)
+ 	return;
        var->n_location_parts++;
        var->location_part[k].offset = offset;
        var->location_part[k].loc = NULL;



More information about the Gcc-patches mailing list