From c35ba141de1fa04373671ba24c73eb0fe4862415 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 19 Sep 2022 12:16:02 -0400 Subject: Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker even though it has but one argument. Somewhat remarkably, we've gotten away with that so far. However, it seems clear that the upcoming C2x standard means to forbid such cases, and compilers that actively break such code likely won't be far behind. So spend the extra few lines of code to do it honestly with a separate walker function. In HEAD, we might as well go further and remove ExecShutdownNode's useless return value. I left that as-is in back branches though, to forestall complaints about ABI breakage. Back-patch, with the thought that this might become of practical importance before our stable branches are all out of service. It doesn't seem to be fixing any live bug on any currently known platform, however. Discussion: https://postgr.es/m/208054.1663534665@sss.pgh.pa.us --- src/backend/executor/execMain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/executor/execMain.c') diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index ef2fd46092e..d78862e660e 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -1691,7 +1691,7 @@ ExecutePlan(EState *estate, * point. */ if (!(estate->es_top_eflags & EXEC_FLAG_BACKWARD)) - (void) ExecShutdownNode(planstate); + ExecShutdownNode(planstate); if (use_parallel_mode) ExitParallelMode(); -- cgit v1.2.3