Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit581a558

Browse files
committed
Fix nested error handling in PG_FINALLY
We need to pop the error stack before running the user-suppliedPG_FINALLY code. Otherwise an error in the cleanup code would end upat the same sigsetjmp() invocation and result in an infinite errorhandling loop.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://www.postgresql.org/message-id/flat/95a822c3-728b-af0e-d7e5-71890507ae0c%402ndquadrant.com
1 parenta0c9685 commit581a558

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎src/backend/utils/adt/xml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3868,7 +3868,7 @@ xml_xmlnodetoxmltype(xmlNodePtr cur, PgXmlErrorContext *xmlerrcxt)
38683868

38693869
result=xmlBuffer_to_xmltype(buf);
38703870
}
3871-
PG_FINALLY()
3871+
PG_FINALLY();
38723872
{
38733873
if (nodefree)
38743874
nodefree(cur_copy);

‎src/include/utils/elog.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,16 @@ extern PGDLLIMPORT ErrorContextCallback *error_context_stack;
338338
} \
339339
else \
340340
_do_rethrow = true; \
341-
{
341+
{ \
342+
PG_exception_stack = _save_exception_stack; \
343+
error_context_stack = _save_context_stack
342344

343345
#definePG_END_TRY() \
344346
} \
345-
PG_exception_stack = _save_exception_stack; \
346-
error_context_stack = _save_context_stack; \
347347
if (_do_rethrow) \
348348
PG_RE_THROW(); \
349+
PG_exception_stack = _save_exception_stack; \
350+
error_context_stack = _save_context_stack; \
349351
} while (0)
350352

351353
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp