Ensure error stack before using as array subscript
Ensure error stack before using as array subscript

-1 is a valid value for errordata_stack_depth until errstart() has
been called which inits the stack. In correct usage it's thus fine
to use it as an array subscript without inspecting it, since demote
and dismiss are useless outside an error context. Incorrect usage
would however cause a memory error so guard against that since it's
the right thing to do.

jmcatamney/gpdb,janebeckman/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,adam8157/gpdb,ashwinstar/gpdb,Chibin/gpdb,xinzweb/gpdb,50wu/gpdb,janebeckman/gpdb,lisakowen/gpdb,Chibin/gpdb,greenplum-db/gpdb,Chibin/gpdb,cjcjameson/gpdb,50wu/gpdb,edespino/gpdb,jmcatamney/gpdb,adam8157/gpdb,cjcjameson/gpdb,lisakowen/gpdb,cjcjameson/gpdb,Chibin/gpdb,50wu/gpdb,jmcatamney/gpdb,edespino/gpdb,edespino/gpdb,greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,janebeckman/gpdb,janebeckman/gpdb,Chibin/gpdb,jmcatamney/gpdb,Chibin/gpdb,cjcjameson/gpdb,adam8157/gpdb,xinzweb/gpdb,adam8157/gpdb,janebeckman/gpdb,janebeckman/gpdb,cjcjameson/gpdb,janebeckman/gpdb,cjcjameson/gpdb,lisakowen/gpdb,xinzweb/gpdb,50wu/gpdb,ashwinstar/gpdb,50wu/gpdb,edespino/gpdb,edespino/gpdb,yuanzhao/gpdb,edespino/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,janebeckman/gpdb,Chibin/gpdb,edespino/gpdb,lisakowen/gpdb,jmcatamney/gpdb,xinzweb/gpdb,adam8157/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,lisakowen/gpdb,Chibin/gpdb,adam8157/gpdb,cjcjameson/gpdb,Chibin/gpdb,edespino/gpdb,janebeckman/gpdb,lisakowen/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,edespino/gpdb,yuanzhao/gpdb,Chibin/gpdb,edespino/gpdb,xinzweb/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,janebeckman/gpdb,adam8157/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,cjcjameson/gpdb,50wu/gpdb,yuanzhao/gpdb