Skip to content

Commit

Permalink
B && BEGIN handling
Browse files Browse the repository at this point in the history
Message-ID: <20010806172911.A2071@fotango.com>

(the intrpvar.h addition moved to the end for bincompat)

p4raw-id: //depot/perl@11601
  • Loading branch information
James A. Duncan authored and jhi committed Aug 7, 2001
1 parent 9bf5227 commit aefff11
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions embedvar.h
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/B/B.xs
Expand Up @@ -528,7 +528,7 @@ minus_c()
void
save_BEGINs()
CODE:
PL_minus_c |= 0x10;
PL_savebegin = TRUE;

SV *
cstring(sv)
Expand Down
11 changes: 5 additions & 6 deletions intrpvar.h
Expand Up @@ -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. */



2 changes: 1 addition & 1 deletion perl.c
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions perlapi.h
Expand Up @@ -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
Expand Down

0 comments on commit aefff11

Please sign in to comment.