summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-11-04 10:26:11 +0100
committerYves Orton <demerphq@gmail.com>2022-11-04 10:35:40 +0100
commitfdec6615b5832b7cecbb10b8782630b054a8de4a (patch)
treedfbb4c421d7467427355ce33208fb334f27d0e54 /sv.c
parent66964e141c6594291e27649d190bc6ca573861f2 (diff)
downloadperl-fdec6615b5832b7cecbb10b8782630b054a8de4a.tar.gz
scope.* - revert and rework SAVECOPWARNINGS change
We can't put PL_compiling or PL_curcop on the save stack as we don't have a way to ensure they cross threads properly. This showed up as a win32 t/op/fork.t failure in the thread based fork emulation layer. This adds a new save type SAVEt_CURCOP_WARNINGS and macro SAVECURCOPWARNINGS() to complement SAVEt_COMPILER_WARNINGS and SAVECOMPILEWARNINGS(). By simply hard coding where the pointers should be restored to we side step the issue of which thread we are in. Thanks to Graham Knop for help identifying that one of my commits was responsible.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index cf92e0d061..139d3fefa2 100644
--- a/sv.c
+++ b/sv.c
@@ -15334,6 +15334,8 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
sv = (const SV *)POPPTR(ss,ix);
TOPPTR(nss,ix) = sv_dup(sv, param);
break;
+ case SAVEt_CURCOP_WARNINGS:
+ /* FALLTHROUGH */
case SAVEt_COMPILE_WARNINGS:
ptr = POPPTR(ss,ix);
TOPPTR(nss,ix) = DUP_WARNINGS((char*)ptr);