diff mbox series

Add missing non-NULL check in cgraphclones

Message ID 20201103193304.GA38403@kam.mff.cuni.cz
State New
Headers show
Series Add missing non-NULL check in cgraphclones | expand

Commit Message

Jan Hubicka Nov. 3, 2020, 7:33 p.m. UTC
Hi,
this patch adds check that info is non-NULL. This happens when we
duplicate thunk with no param adjustments.

Boottrapped/regtested x86_64, comitted.

gcc/ChangeLog:

2020-11-03  Jan Hubicka  <hubicka@ucw.cz>

	PR ipa/97698
	* cgraphclones.c (duplicate_thunk_for_node): Check that info is
	non-NULL.
diff mbox series

Patch

diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index b5793f90b64..36ca6477139 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -239,7 +239,7 @@  duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node)
   new_thunk->thunk = thunk->thunk;
   new_thunk->unique_name = in_lto_p;
   new_thunk->former_clone_of = thunk->decl;
-  if (info->param_adjustments)
+  if (info && info->param_adjustments)
     clone_info::get_create (new_thunk)->param_adjustments
 	   = info->param_adjustments;
   new_thunk->unit_id = thunk->unit_id;