summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2009-07-26 02:19:20 +0100
committerDavid Mitchell <davem@iabyn.com>2009-07-26 02:19:20 +0100
commitf0c5aa00eeb992584d6996af147c4c51fe7a6540 (patch)
tree23678caf0326b92508229719aefabe59541c8c34 /sv.c
parent2788925507d099c7b1e9382ad2ddc4f3d692de28 (diff)
downloadperl-f0c5aa00eeb992584d6996af147c4c51fe7a6540.tar.gz
dup saved_curcop in PL_parser
Commit 7c4baf47da introduced the saved_curcop field of PL_parser, but omitted to copy the entry during interpreter cloning. This may fix bugs [RT #58468], [RT #59498]
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index b26bbeffa5..8bfe441089 100644
--- a/sv.c
+++ b/sv.c
@@ -10426,6 +10426,10 @@ Perl_parser_dup(pTHX_ const yy_parser *const proto, CLONE_PARAMS *const param)
Copy(proto->nexttype, parser->nexttype, 5, I32);
parser->nexttoke = proto->nexttoke;
#endif
+
+ /* XXX should clone saved_curcop here, but we aren't passed
+ * proto_perl; so do it in perl_clone_using instead */
+
return parser;
}
@@ -12084,6 +12088,13 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_parser = parser_dup(proto_perl->Iparser, param);
+ /* XXX this only works if the saved cop has already been cloned */
+ if (proto_perl->Iparser) {
+ PL_parser->saved_curcop = (COP*)any_dup(
+ proto_perl->Iparser->saved_curcop,
+ proto_perl);
+ }
+
PL_subline = proto_perl->Isubline;
PL_subname = sv_dup_inc(proto_perl->Isubname, param);