Remove ppport.h's broken re-implementation of eval_pv().
authorTom Lane <[email protected]>
Wed, 9 Feb 2022 00:25:56 +0000 (19:25 -0500)
committerTom Lane <[email protected]>
Wed, 9 Feb 2022 00:26:30 +0000 (19:26 -0500)
Recent versions of Devel::PPPort try to redefine eval_pv() to
dodge a bug in pre-5.31 Perl versions.  Unfortunately the redefinition
fails on compilers that don't support statements nested within
expressions.  However, we aren't actually interested in this bug fix,
since we always call eval_pv() with croak_on_error = FALSE.
So, until there's an upstream fix for this breakage, just comment
out the macro to revert to the older behavior.

Per report from Wei Sun, as well as previous buildfarm failure
on pademelon (which I'd unfortunately not looked at carefully
enough to understand the cause).  Back-patch to all supported
versions, since we're using the same ppport.h in all.

Discussion: https://postgr.es/m/[email protected]
Report: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=pademelon&dt=2022-02-02%2001%3A22%3A58

src/pl/plperl/ppport.h

index c1ee55c366f5e4f40b1768d23795c8fc5a98b381..1f6cf465df687868d1454abcb9e844f5ce78d504 100644 (file)
@@ -15077,6 +15077,13 @@ DPPP_(my_croak_xs_usage)(const CV *const cv, const char *const params)
 # endif
 #endif
 
+/*
+ * This implementation of eval_pv fails on compilers that don't allow
+ * statements nested within expressions.  However, we don't care about the bug
+ * it's trying to fix, because we only call eval_pv with croak_on_error=0.
+ * So, pending an upstream fix for this, just remove it.
+ */
+#ifdef NOT_USED
 /* Older Perl versions have broken croak_on_error=1 */
 #if (PERL_BCDVERSION < 0x5031002)
 # ifdef eval_pv
@@ -15088,6 +15095,7 @@ DPPP_(my_croak_xs_usage)(const CV *const cv, const char *const params)
 #  endif
 # endif
 #endif
+#endif /* NOT_USED */
 
 /* This is backport for Perl 5.3.97d and older which do not provide perl_eval_pv */
 #ifndef eval_pv