Skip to content

Commit 32c9cf2

Browse files
committed
Initialize fallback command tag for CompileFunctionStmt
`CreateCommandTag()` can leave `tag` uninitialized for `CompileFunctionStmt` when objtype is neither FUNCTION nor PROCEDURE. Callers normally pass one of those two values, but Clang still reports the missing fallback path. Warning excerpt: ``` utility.c:2757:13: warning: variable 'tag' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] ``` Set `tag = CMDTAG_UNKNOWN` in the remaining branch so the fallback behavior is explicit.
1 parent 0da228b commit 32c9cf2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/backend/tcop/utility.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,6 +2748,8 @@ CreateCommandTag(Node *parsetree)
27482748
tag = CMDTAG_ALTER_PROCEDURE;
27492749
else if (((CompileFunctionStmt *) parsetree)->objtype == OBJECT_FUNCTION)
27502750
tag = CMDTAG_ALTER_FUNCTION;
2751+
else
2752+
tag = CMDTAG_UNKNOWN;
27512753
break;
27522754

27532755
case T_GrantStmt:

0 commit comments

Comments
 (0)