*** a/src/backend/utils/fmgr/fmgr.c
--- b/src/backend/utils/fmgr/fmgr.c
***************
*** 399,405 **** fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
  		elog(ERROR, "cache lookup failed for language %u", language);
  	languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
  
! 	fmgr_info(languageStruct->lanplcallfoid, &plfinfo);
  	finfo->fn_addr = plfinfo.fn_addr;
  
  	/*
--- 399,406 ----
  		elog(ERROR, "cache lookup failed for language %u", language);
  	languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
  
! 	fmgr_info_cxt_security(languageStruct->lanplcallfoid, &plfinfo,
! 						   CurrentMemoryContext, true);
  	finfo->fn_addr = plfinfo.fn_addr;
  
  	/*
