summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/Miniperl.pm
diff options
context:
space:
mode:
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/Miniperl.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/Miniperl.pm44
1 files changed, 24 insertions, 20 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/Miniperl.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/Miniperl.pm
index cdc1244f02..18627f8a5e 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/Miniperl.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/Miniperl.pm
@@ -1,12 +1,11 @@
#!./perl -w
package ExtUtils::Miniperl;
use strict;
-require Exporter;
+use Exporter 'import';
use ExtUtils::Embed 1.31, qw(xsi_header xsi_protos xsi_body);
-our @ISA = qw(Exporter);
our @EXPORT = qw(writemain);
-our $VERSION = '1.10';
+our $VERSION = '1.13';
# blead will run this with miniperl, hence we can't use autodie or File::Temp
my $temp;
@@ -100,9 +99,6 @@ main(int argc, char **argv, char **env)
#ifndef NO_ENV_ARRAY_IN_MAIN
PERL_UNUSED_ARG(env);
#endif
-#ifndef PERL_USE_SAFE_PUTENV
- PL_use_safe_putenv = FALSE;
-#endif /* PERL_USE_SAFE_PUTENV */
/* if user wants control of gprof profiling off by default */
/* noop unless Configure is given -Accflags=-DPERL_GPROF_CONTROL */
@@ -139,8 +135,29 @@ main(int argc, char **argv, char **env)
PL_perl_destruct_level = 0;
}
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
- if (!perl_parse(my_perl, xs_init, argc, argv, (char **)NULL))
+ if (!perl_parse(my_perl, xs_init, argc, argv, (char **)NULL)) {
+
+ /* perl_parse() may end up starting its own run loops, which
+ * might end up "leaking" PL_restartop from the parse phase into
+ * the run phase which then ends up confusing run_body(). This
+ * leakage shouldn't happen and if it does its a bug.
+ *
+ * Note we do not do this assert in perl_run() or perl_parse()
+ * as there are modules out there which explicitly set
+ * PL_restartop before calling perl_run() directly from XS code
+ * (Coro), and it is conceivable PL_restartop could be set prior
+ * to calling perl_parse() by XS code as well.
+ *
+ * What we want to check is that the top level perl_parse(),
+ * perl_run() pairing does not allow a leaking PL_restartop, as
+ * that indicates a bug in perl. By putting the assert here we
+ * can validate that Perl itself is operating correctly without
+ * risking breakage to XS code under DEBUGGING. - Yves
+ */
+ assert(!PL_restartop);
+
perl_run(my_perl);
+ }
#ifndef PERL_MICRO
/* Unregister our signal handler before destroying my_perl */
@@ -155,19 +172,6 @@ main(int argc, char **argv, char **env)
perl_free(my_perl);
-#if defined(USE_ENVIRON_ARRAY) && defined(PERL_TRACK_MEMPOOL) && !defined(NO_ENV_ARRAY_IN_MAIN)
- /*
- * The old environment may have been freed by perl_free()
- * when PERL_TRACK_MEMPOOL is defined, but without having
- * been restored by perl_destruct() before (this is only
- * done if destruct_level > 0).
- *
- * It is important to have a valid environment for atexit()
- * routines that are eventually called.
- */
- environ = env;
-#endif
-
PERL_SYS_TERM();
exit(exitstatus);