From patchwork Thu Apr 28 00:33:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: trial fix to null pointer free Date: Wed, 27 Apr 2011 14:33:58 -0000 From: Diego Novillo X-Patchwork-Id: 93131 Message-Id: To: Xinliang David Li Cc: GCC Patches , Jan Hubicka On Wed, Apr 27, 2011 at 19:23, Xinliang David Li wrote: > This can happen when the module does not have function bodies. > > > Ok after testing? > > Thanks, > > David > > > 2011-04-27  Xinliang David Li   > >        * value-prof.c (del_node_map): Do not free >        null pointer. > remove the assignment 'cgraph_node_map = NULL' since VEC_free already clears it. Diego. Index: value-prof.c =================================================================== --- value-prof.c (revision 172977) +++ value-prof.c (working copy) @@ -1086,8 +1086,9 @@ init_node_map (void) void del_node_map (void) { - VEC_free (cgraph_node_ptr, heap, cgraph_node_map); - cgraph_node_map = NULL; + if (cgraph_node_map) + VEC_free (cgraph_node_ptr, heap, cgraph_node_map); + cgraph_node_map = NULL; } This is not necessary. Freeing a NULL VEC has no effect. You could