]> granicus.if.org Git - postgresql/commitdiff
Silence complaint about dead assignment
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 30 Jan 2018 01:42:15 +0000 (20:42 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 30 Jan 2018 01:43:43 +0000 (20:43 -0500)
The preferred place for "placate compiler" assignments is after
elog(ERROR), not before it.  Otherwise, scan-build complains about a
dead assignment.

src/backend/commands/tablecmds.c

index ea03fd2ecf35c0ae931bc34e5640ccb5b60dd50f..37c7d6688190329b6bc28eb6ecc3158bc5044334 100644 (file)
@@ -13251,8 +13251,8 @@ RangeVarCallbackForAlterRelation(const RangeVar *rv, Oid relid, Oid oldrelid,
                reltype = ((AlterTableStmt *) stmt)->relkind;
        else
        {
-               reltype = OBJECT_TABLE; /* placate compiler */
                elog(ERROR, "unrecognized node type: %d", (int) nodeTag(stmt));
+               reltype = OBJECT_TABLE; /* placate compiler */
        }
 
        /*