Commit 57d0051
committed
Move return statements out of PG_TRY blocks.
If we exit a PG_TRY block early via "continue", "break", "goto", or
"return", we'll skip unwinding its exception stack. This change
moves a couple of such "return" statements in PL/Python out of
PG_TRY blocks. This was introduced in d0aa965 and affects all
supported versions.
We might also be able to add compile-time checks to prevent
recurrence, but that is left as a future exercise.
Reported-by: Mikhail Gribkov, Xing Guo
Author: Xing Guo
Reviewed-by: Michael Paquier, Andres Freund, Tom Lane
Discussion: https://postgr.es/m/CAMEv5_v5Y%2B-D%3DCO1%2Bqoe16sAmgC4sbbQjz%2BUtcHmB6zcgS%2B5Ew%40mail.gmail.com
Discussion: https://postgr.es/m/CACpMh%2BCMsGMRKFzFMm3bYTzQmMU5nfEEoEDU2apJcc4hid36AQ%40mail.gmail.com
Backpatch-through: 11 (all supported versions)1 parent f75cec4 commit 57d0051
1 file changed
+36
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
417 | 426 | | |
418 | 427 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | 428 | | |
424 | 429 | | |
425 | 430 | | |
| |||
683 | 688 | | |
684 | 689 | | |
685 | 690 | | |
686 | | - | |
687 | | - | |
| 691 | + | |
| 692 | + | |
688 | 693 | | |
689 | | - | |
690 | | - | |
| 694 | + | |
| 695 | + | |
691 | 696 | | |
692 | 697 | | |
693 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
694 | 708 | | |
695 | | - | |
696 | | - | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
697 | 713 | | |
| 714 | + | |
| 715 | + | |
698 | 716 | | |
| 717 | + | |
| 718 | + | |
699 | 719 | | |
700 | 720 | | |
701 | 721 | | |
| |||
835 | 855 | | |
836 | 856 | | |
837 | 857 | | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
844 | 861 | | |
845 | 862 | | |
846 | 863 | | |
| |||
861 | 878 | | |
862 | 879 | | |
863 | 880 | | |
| 881 | + | |
864 | 882 | | |
865 | 883 | | |
866 | 884 | | |
| |||
0 commit comments