This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[google]: initialize language field for clone function struct
- From: Xinliang David Li <davidxl at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 29 Apr 2011 16:38:34 -0700
- Subject: [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 ();