@@ -220,9 +220,9 @@ int_enum(PG_FUNCTION_ARGS)
220220PG_RETURN_NULL ();
221221}
222222
223- if (!fcinfo -> context )
223+ if (!fcinfo -> flinfo -> fn_extra )
224224{
225- /* Allocatea workingcontext */
225+ /* Allocate workingstate */
226226MemoryContext oldcontext ;
227227
228228oldcontext = MemoryContextSwitchTo (fcinfo -> flinfo -> fn_mcxt );
@@ -247,19 +247,20 @@ int_enum(PG_FUNCTION_ARGS)
247247if (pc -> p -> a .ndim > 1 )
248248elog (ERROR ,"int_enum only accepts 1-D arrays" );
249249pc -> num = 0 ;
250- fcinfo -> context = (Node * )pc ;
250+ fcinfo -> flinfo -> fn_extra = (void * )pc ;
251251MemoryContextSwitchTo (oldcontext );
252252}
253- else /* use an existing one */
254- pc = (CTX * )fcinfo -> context ;
253+ else /* use existing working state */
254+ pc = (CTX * )fcinfo -> flinfo -> fn_extra ;
255+
255256/* Are we done yet? */
256257if (pc -> p -> a .ndim < 1 || pc -> num >=pc -> p -> items )
257258{
258259/* We are done */
259260if (pc -> flags & TOASTED )
260261pfree (pc -> p );
261- pfree (fcinfo -> context );
262- fcinfo -> context = NULL ;
262+ pfree (pc );
263+ fcinfo -> flinfo -> fn_extra = NULL ;
263264rsi -> isDone = ExprEndResult ;
264265}
265266else