OSDN Git Service

Insert additional compiler placation into objectaddress.c.
authorRobert Haas <rhaas@postgresql.org>
Fri, 27 Aug 2010 21:31:19 +0000 (21:31 +0000)
committerRobert Haas <rhaas@postgresql.org>
Fri, 27 Aug 2010 21:31:19 +0000 (21:31 +0000)
Peter Eisentraut reports that some bits of the "address" variable
in get_object_address() give "may be used uninitialized" warnings;
this likes the only excuse his compiler could have for thinking
that's possible.

src/backend/catalog/objectaddress.c

index 9eec92f..9054d75 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/catalog/objectaddress.c,v 1.1 2010/08/27 11:47:41 rhaas Exp $
+ *       $PostgreSQL: pgsql/src/backend/catalog/objectaddress.c,v 1.2 2010/08/27 21:31:19 rhaas Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -215,6 +215,10 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
                        break;
                default:
                        elog(ERROR, "unrecognized objtype: %d", (int) objtype);
+                       /* placate compiler, in case it things elog might return */
+                       address.classId = InvalidOid;
+                       address.objectId = InvalidOid;
+                       address.objectSubId = 0;
        }
 
        /*