Same fix as for other case where PL_parser is NULL when calling newSTATEOP().
--
Paul Evans
=== modified file 'lib/Object/Pad.xs'
--- old/lib/Object/Pad.xs 2020-09-03 19:27:15 +0000
+++ new/lib/Object/Pad.xs 2020-09-03 19:40:48 +0000
@@ -977,6 +977,8 @@
meta->type = type;
meta->name = SvREFCNT_inc(name);
+ HV *stash = meta->stash = gv_stashsv(name, GV_ADD);
+
meta->sealed = false;
meta->offset = 0;
meta->slots = newAV();
@@ -989,13 +991,25 @@
meta->buildblocks = NULL;
meta->initslots = NULL;
+ if(!PL_parser) {
+ /* We need to generate just enough of a PL_parser to keep newSTATEOP()
+ * happy, otherwise it will SIGSEGV (RT133258)
+ */
+ SAVEVPTR(PL_parser);
+ Newxz(PL_parser, 1, yy_parser);
+ SAVEFREEPV(PL_parser);
+
+ PL_parser->copline = NOLINE;
+#if HAVE_PERL_VERSION(5, 20, 0)
+ PL_parser->preambling = NOLINE;
+#endif
+ }
+
meta->tmpcop = (COP *)newSTATEOP(0, NULL, NULL);
CopFILE_set(meta->tmpcop, __FILE__);
meta->methodscope = NULL;
- HV *stash = meta->stash = gv_stashsv(name, GV_ADD);
-
AV *isa;
{
SV *isaname = newSVpvf("%" SVf "::ISA", name);