Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit c5bb2ff

Browse files
committed
Improve set phase UNITCHECK
Politely undo PERL_SET_PHASE(PERL_PHASE_UNITCHECK) when this phase has ended. Added with e77321e Jan 2017
1 parent b292c2e commit c5bb2ff

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

perl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,9 +1716,9 @@ perl_parse(pTHXx_ XSINIT_t xsinit, int argc, char **argv, char **env)
17161716
PL_dowarn = G_WARN_OFF;
17171717

17181718
JMPENV_PUSH(ret);
1719-
switch (ret) {
1719+
switch (ret) { /* the return value of sigsetjmp */
17201720
case 0:
1721-
parse_body(env,xsinit);
1721+
parse_body(env, xsinit);
17221722
if (PL_unitcheckav) {
17231723
PERL_SET_PHASE(PERL_PHASE_UNITCHECK);
17241724
call_list(oldscope, PL_unitcheckav);
@@ -5424,8 +5424,10 @@ void
54245424
Perl_xs_boot_epilog(pTHX_ const I32 ax)
54255425
{
54265426
if (PL_unitcheckav) {
5427+
enum perl_phase old = PL_phase;
54275428
PERL_SET_PHASE(PERL_PHASE_UNITCHECK);
54285429
call_list(PL_scopestack_ix, PL_unitcheckav);
5430+
PERL_SET_PHASE(old);
54295431
}
54305432
XSRETURN_YES;
54315433
}

pp_ctl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3668,9 +3668,11 @@ S_doeval_compile(pTHX_ U8 gimme, CV* outside, U32 seq, HV *hh)
36683668
}
36693669

36703670
if (PL_unitcheckav) {
3671+
enum perl_phase old = PL_phase;
36713672
OP *es = PL_eval_start;
36723673
call_list(PL_scopestack_ix, PL_unitcheckav);
36733674
PL_eval_start = es;
3675+
PERL_SET_PHASE(old);
36743676
}
36753677

36763678
CvDEPTH(evalcv) = 1;

0 commit comments

Comments
 (0)