X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_ctl.c;h=7ff4858bfe45327e14463402a7a2384f6b7cf85f;hb=c5375c28ff9f285618d7079f4044f72aad1773ab;hp=ffc80c8e433e2d352b64e151d463268baeeb20f5;hpb=b37c2d43c8bccbefe3985273e9661833102148d0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_ctl.c b/pp_ctl.c index ffc80c8..7ff4858 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2625,7 +2625,13 @@ PP(pp_exit) #endif } PL_exit_flags |= PERL_EXIT_EXPECTED; +#ifdef PERL_MAD + /* KLUDGE: disable exit 0 in BEGIN blocks when we're just compiling */ + if (anum || !(PL_minus_c && PL_madskills)) + my_exit(anum); +#else my_exit(anum); +#endif PUSHs(&PL_sv_undef); RETURN; } @@ -2885,7 +2891,8 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) CvPADLIST(PL_compcv) = pad_new(padnew_SAVE); - SAVEMORTALIZESV(PL_compcv); /* must remain until end of current statement */ + if (!PL_madskills) + SAVEMORTALIZESV(PL_compcv); /* must remain until end of current statement */ /* make sure we compile in the right package */ @@ -2898,6 +2905,11 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) SAVEFREESV(PL_beginav); SAVEI32(PL_error_count); +#ifdef PERL_MAD + SAVEI32(PL_madskills); + PL_madskills = 0; +#endif + /* try to compile it */ PL_eval_root = NULL;