summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorSpider.Boardman@Orb.Nashua.NH.US <Spider.Boardman@Orb.Nashua.NH.US>2000-08-18 14:41:14 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-19 14:06:57 +0000
commit1e6dc0b685b17e94025b09758a184a17aee43b32 (patch)
tree8656c4d82a8a8abed3ffb7007c06b964a89d6aba /regcomp.c
parent50588fdeefaaa7117c6e7bd89a92fc19a3dba2b1 (diff)
downloadperl-1e6dc0b685b17e94025b09758a184a17aee43b32.tar.gz
Fix a core dump in lib/selfloader under -DDEBUGGING.
Subject: PATCH @6698 for [ID 20000817.007] Not OK: perl v5.7.0 +SUIDMAIL +DEVEL6676 on alpha-dec_osf 4.0f (UNINSTALLED) Message-Id: <200008182241.SAA29667@Orb.Nashua.NH.US> p4raw-id: //depot/perl@6709
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index d2195b0ca1..c13eb26a4b 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4372,8 +4372,13 @@ Perl_pregfree(pTHX_ struct regexp *r)
Perl_croak(aTHX_ "panic: pregfree comppad");
old_comppad = PL_comppad;
old_curpad = PL_curpad;
- PL_comppad = new_comppad;
- PL_curpad = AvARRAY(new_comppad);
+ /* Watch out for global destruction's random ordering. */
+ if (SvTYPE(new_comppad) == SVt_PVAV) {
+ PL_comppad = new_comppad;
+ PL_curpad = AvARRAY(new_comppad);
+ }
+ else
+ PL_curpad = NULL;
op_free((OP_4tree*)r->data->data[n]);
PL_comppad = old_comppad;
PL_curpad = old_curpad;