From: James A. Duncan Date: Mon, 6 Aug 2001 17:29:11 +0000 (+0100) Subject: B && BEGIN handling X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aefff11f7e121678e7cd0c4ebdd14e491a765ed2;p=p5sagit%2Fp5-mst-13.2.git B && BEGIN handling Message-ID: <20010806172911.A2071@fotango.com> (the intrpvar.h addition moved to the end for bincompat) p4raw-id: //depot/perl@11601 --- diff --git a/embedvar.h b/embedvar.h index f6d6aac..d0a7ec4 100644 --- a/embedvar.h +++ b/embedvar.h @@ -368,6 +368,7 @@ #define PL_rsfp (PERL_GET_INTERP->Irsfp) #define PL_rsfp_filters (PERL_GET_INTERP->Irsfp_filters) #define PL_runops (PERL_GET_INTERP->Irunops) +#define PL_savebegin (PERL_GET_INTERP->Isavebegin) #define PL_sawampersand (PERL_GET_INTERP->Isawampersand) #define PL_sh_path (PERL_GET_INTERP->Ish_path) #define PL_sig_pending (PERL_GET_INTERP->Isig_pending) @@ -653,6 +654,7 @@ #define PL_rsfp (vTHX->Irsfp) #define PL_rsfp_filters (vTHX->Irsfp_filters) #define PL_runops (vTHX->Irunops) +#define PL_savebegin (vTHX->Isavebegin) #define PL_sawampersand (vTHX->Isawampersand) #define PL_sh_path (vTHX->Ish_path) #define PL_sig_pending (vTHX->Isig_pending) @@ -1076,6 +1078,7 @@ #define PL_rsfp (aTHXo->interp.Irsfp) #define PL_rsfp_filters (aTHXo->interp.Irsfp_filters) #define PL_runops (aTHXo->interp.Irunops) +#define PL_savebegin (aTHXo->interp.Isavebegin) #define PL_sawampersand (aTHXo->interp.Isawampersand) #define PL_sh_path (aTHXo->interp.Ish_path) #define PL_sig_pending (aTHXo->interp.Isig_pending) @@ -1362,6 +1365,7 @@ #define PL_Irsfp PL_rsfp #define PL_Irsfp_filters PL_rsfp_filters #define PL_Irunops PL_runops +#define PL_Isavebegin PL_savebegin #define PL_Isawampersand PL_sawampersand #define PL_Ish_path PL_sh_path #define PL_Isig_pending PL_sig_pending diff --git a/ext/B/B.xs b/ext/B/B.xs index df53d9a..c3ce0ed 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -528,7 +528,7 @@ minus_c() void save_BEGINs() CODE: - PL_minus_c |= 0x10; + PL_savebegin = TRUE; SV * cstring(sv) diff --git a/intrpvar.h b/intrpvar.h index 4e92302..4fa7374 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -476,18 +476,17 @@ PERLVAR(Inumeric_radix_sv, SV *) /* The radix separator if not '.' */ #endif #if defined(USE_ITHREADS) -PERLVAR(Iregex_pad, SV**) /* All regex objects */ -PERLVAR(Iregex_padav, AV*) /* All regex objects */ +PERLVAR(Iregex_pad, SV**) /* All regex objects */ +PERLVAR(Iregex_padav, AV*) /* All regex objects */ #ifdef USE_REENTRANT_API -PERLVAR(Ireentrant_buffer, REBUF*) /* were we store _r buffers */ +PERLVAR(Ireentrant_buffer, REBUF*) /* here we store the _r buffers */ #endif #endif +PERLVAR(Isavebegin, bool) /* save BEGINs for compiler */ + /* New variables must be added to the very end for binary compatibility. * XSUB.h provides wrapper functions via perlapi.h that make this * irrelevant, but not all code may be expected to #include XSUB.h. */ - - - diff --git a/perl.c b/perl.c index 28e8761..17fbac4 100644 --- a/perl.c +++ b/perl.c @@ -3860,7 +3860,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList) while (AvFILL(paramList) >= 0) { cv = (CV*)av_shift(paramList); - if ((PL_minus_c & 0x10) && (paramList == PL_beginav)) { + if (PL_savebegin && (paramList == PL_beginav)) { /* save PL_beginav for compiler */ if (! PL_beginav_save) PL_beginav_save = newAV(); diff --git a/perlapi.h b/perlapi.h index 71384ac..6a5a6c7 100644 --- a/perlapi.h +++ b/perlapi.h @@ -472,6 +472,8 @@ START_EXTERN_C #define PL_rsfp_filters (*Perl_Irsfp_filters_ptr(aTHXo)) #undef PL_runops #define PL_runops (*Perl_Irunops_ptr(aTHXo)) +#undef PL_savebegin +#define PL_savebegin (*Perl_Isavebegin_ptr(aTHXo)) #undef PL_sawampersand #define PL_sawampersand (*Perl_Isawampersand_ptr(aTHXo)) #undef PL_sh_path