summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorAlexander Gough <alex-p5p@earth.li>2006-10-19 14:04:12 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-19 15:54:15 +0000
commit3c10abe350e3df50f8ef0ac37c9d14175bc899f1 (patch)
tree306a14e8bd8d1b6ebe927f3a074d367f70729e50 /perl.c
parentf0ac4cdb6e00777d18589f0326b32a86989110af (diff)
downloadperl-3c10abe350e3df50f8ef0ac37c9d14175bc899f1.tar.gz
stab at UNITCHECK blocks
Message-ID: <20061019120412.GA12290@the.earth.li> p4raw-id: //depot/perl@29053
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index ada96a23af..7353d3291b 100644
--- a/perl.c
+++ b/perl.c
@@ -944,12 +944,16 @@ perl_destruct(pTHXx)
SvREFCNT_dec(PL_endav);
SvREFCNT_dec(PL_checkav);
SvREFCNT_dec(PL_checkav_save);
+ SvREFCNT_dec(PL_unitcheckav);
+ SvREFCNT_dec(PL_unitcheckav_save);
SvREFCNT_dec(PL_initav);
PL_beginav = NULL;
PL_beginav_save = NULL;
PL_endav = NULL;
PL_checkav = NULL;
PL_checkav_save = NULL;
+ PL_unitcheckav = NULL;
+ PL_unitcheckav_save = NULL;
PL_initav = NULL;
/* shortcuts just get cleared */
@@ -1605,6 +1609,8 @@ setuid perl scripts securely.\n");
switch (ret) {
case 0:
parse_body(env,xsinit);
+ if (PL_unitcheckav)
+ call_list(oldscope, PL_unitcheckav);
if (PL_checkav)
call_list(oldscope, PL_checkav);
ret = 0;
@@ -1618,6 +1624,8 @@ setuid perl scripts securely.\n");
LEAVE;
FREETMPS;
PL_curstash = PL_defstash;
+ if (PL_unitcheckav)
+ call_list(oldscope, PL_unitcheckav);
if (PL_checkav)
call_list(oldscope, PL_checkav);
ret = STATUS_EXIT;
@@ -5113,6 +5121,12 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
PL_checkav_save = newAV();
av_push(PL_checkav_save, (SV*)cv);
}
+ else if (paramList == PL_unitcheckav) {
+ /* save PL_unitcheckav for compiler */
+ if (! PL_unitcheckav_save)
+ PL_unitcheckav_save = newAV();
+ av_push(PL_unitcheckav_save, (SV*)cv);
+ }
} else {
if (!PL_madskills)
SAVEFREESV(cv);
@@ -5143,6 +5157,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
"%s failed--call queue aborted",
paramList == PL_checkav ? "CHECK"
: paramList == PL_initav ? "INIT"
+ : paramList == PL_unitcheckav ? "UNITCHECK"
: "END");
while (PL_scopestack_ix > oldscope)
LEAVE;
@@ -5171,6 +5186,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
Perl_croak(aTHX_ "%s failed--call queue aborted",
paramList == PL_checkav ? "CHECK"
: paramList == PL_initav ? "INIT"
+ : paramList == PL_unitcheckav ? "UNITCHECK"
: "END");
}
my_exit_jump();