This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[google]: initialize language field for clone function struct


During function cloning, the language field of the src func is not
copied. This can lead to null dereference when gcc calls into langhook
functions.  Unfortunately, I lost track of the test case.

Ok for trunk ?

Thanks,

David


2011-04-29  Xinliang David Li  <davidxl@google.com>

	* tree-inline.c (ininitialize_cfun): Initialize
	language field for clone cfun.
Index: tree-inline.c
===================================================================
--- tree-inline.c	(revision 173176)
+++ tree-inline.c	(working copy)
@@ -2087,6 +2087,7 @@ initialize_cfun (tree new_fndecl, tree c
   cfun->returns_struct = src_cfun->returns_struct;
   cfun->returns_pcc_struct = src_cfun->returns_pcc_struct;
   cfun->after_tree_profile = src_cfun->after_tree_profile;
+  cfun->language = src_cfun->language;
 
   init_empty_tree_cfg ();
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]