Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6b4a176

Browse files
committed
Silence compiler warnings
In GetCachedPlan(), initialize 'plan' to silence a compiler warning, butalso add an Assert() to make sure we don't ever actually fall throughwith 'plan' still being set to NULL, since we are about to dereferenceit.Back-patch back to 9.2.Author: Stephen FrostDiscussion:https://postgr.es/m/20161129152102.GR13284%40tamriel.snowman.net
1 parent3f94796 commit6b4a176

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/utils/cache/plancache.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ CachedPlan *
10931093
GetCachedPlan(CachedPlanSource*plansource,ParamListInfoboundParams,
10941094
booluseResOwner)
10951095
{
1096-
CachedPlan*plan;
1096+
CachedPlan*plan=NULL;
10971097
List*qlist;
10981098
boolcustomplan;
10991099

@@ -1175,6 +1175,8 @@ GetCachedPlan(CachedPlanSource *plansource, ParamListInfo boundParams,
11751175
}
11761176
}
11771177

1178+
Assert(plan!=NULL);
1179+
11781180
/* Flag the plan as in use by caller */
11791181
if (useResOwner)
11801182
ResourceOwnerEnlargePlanCacheRefs(CurrentResourceOwner);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp