diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 3bc1716431..1ec16f49b2 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -3868,7 +3868,7 @@ xml_xmlnodetoxmltype(xmlNodePtr cur, PgXmlErrorContext *xmlerrcxt) result = xmlBuffer_to_xmltype(buf); } - PG_FINALLY() + PG_FINALLY(); { if (nodefree) nodefree(cur_copy); diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 853c2e0709..47412a831f 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -338,14 +338,16 @@ extern PGDLLIMPORT ErrorContextCallback *error_context_stack; } \ else \ _do_rethrow = true; \ - { + { \ + PG_exception_stack = _save_exception_stack; \ + error_context_stack = _save_context_stack #define PG_END_TRY() \ } \ - PG_exception_stack = _save_exception_stack; \ - error_context_stack = _save_context_stack; \ if (_do_rethrow) \ PG_RE_THROW(); \ + PG_exception_stack = _save_exception_stack; \ + error_context_stack = _save_context_stack; \ } while (0) /*