summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2003-10-16 20:03:44 +0000
committerDave Mitchell <davem@fdisolutions.com>2003-10-16 20:03:44 +0000
commit4e380990fe579cbec68c15cb8ee072f2d6644a71 (patch)
tree35f69a288294af32bc65c6fdbdfa759d4279d280 /perl.c
parent4c9cc5953a3992eecff824aeaacb5b7670e2db46 (diff)
downloadperl-4e380990fe579cbec68c15cb8ee072f2d6644a71.tar.gz
Ensure PL_comppad/curpad point to PL_main_cv's padlist when
PL_main_root is freed; this may not have been be the case if a thread other than the main one is the last to be destroyed p4raw-id: //depot/perl@21470
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index c707900a54..889b49326e 100644
--- a/perl.c
+++ b/perl.c
@@ -354,6 +354,10 @@ perl_destruct(pTHXx)
/* Destroy the main CV and syntax tree */
if (PL_main_root) {
+ /* ensure comppad/curpad to refer to main's pad */
+ if (CvPADLIST(PL_main_cv)) {
+ PAD_SET_CUR_NOSAVE(CvPADLIST(PL_main_cv), 1);
+ }
op_free(PL_main_root);
PL_main_root = Nullop;
}