[PATCH] Plug memleak in create_variable_info_for

Richard Guenther rguenther@suse.de
Tue Sep 18 13:04:00 GMT 2007


This plugs a memleak where we didn't free the fieldstack VEC if the
VEC is too big for using field sensitivity.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to mainline.
It doesn't really fix PR31863 though.

Richard.

2007-09-18  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/31863
	* tree-ssa-structalias.c (create_variable_info_for): Always
	free the fieldstack.

Index: tree-ssa-structalias.c
===================================================================
*** tree-ssa-structalias.c	(revision 128538)
--- tree-ssa-structalias.c	(working copy)
*************** create_variable_info_for (tree decl, con
*** 4500,4507 ****
  
  	  stats.total_vars++;
  	}
-       VEC_free (fieldoff_s, heap, fieldstack);
      }
    return index;
  }
  
--- 4500,4509 ----
  
  	  stats.total_vars++;
  	}
      }
+ 
+   VEC_free (fieldoff_s, heap, fieldstack);
+ 
    return index;
  }
  



More information about the Gcc-patches mailing list