- diff --git a/embed.fnc b/embed.fnc
- index dc667b7..6014c1f 100644
- --- a/embed.fnc
- +++ b/embed.fnc
- @@ -888,7 +888,7 @@ sd |void |pad_reset
- : Used in op.c
- pd |void |pad_swipe |PADOFFSET po|bool refadjust
- : FIXME
- -p |void |peep |NULLOK OP* o
- +p |void |peep |NULLOK OP* o|NN void *next
- : Defined in doio.c, used only in pp_hot.c
- dopM |PerlIO*|start_glob |NN SV *tmpglob|NN IO *io
- #if defined(USE_REENTRANT_API)
- diff --git a/embed.h b/embed.h
- index 07aa965..5312d22 100644
- --- a/embed.h
- +++ b/embed.h
- @@ -3150,7 +3150,7 @@
- #endif
- #ifdef PERL_CORE
- #define pad_swipe(a,b) Perl_pad_swipe(aTHX_ a,b)
- -#define peep(a) Perl_peep(aTHX_ a)
- +#define peep(a,b) Perl_peep(aTHX_ a,b)
- #endif
- #if defined(USE_REENTRANT_API)
- #define reentrant_size() Perl_reentrant_size(aTHX)
- diff --git a/op.c b/op.c
- index 276e100..e27166b 100644
- --- a/op.c
- +++ b/op.c
- @@ -103,7 +103,8 @@ recursive, but it's recursive on basic blocks, not on tree nodes.
- #include "perl.h"
- #include "keywords.h"
- -#define CALL_PEEP(o) CALL_FPTR(PL_peepp)(aTHX_ o)
- +#define CALL_A_PEEP(peep, o) CALL_FPTR(peep)(aTHX_ o, peep)
- +#define CALL_PEEP(o) CALL_A_PEEP(PL_peepp, o)
- #define CALL_OPFREEHOOK(o) if (PL_opfreehook) CALL_FPTR(PL_opfreehook)(aTHX_ o)
- #if defined(PL_OP_SLAB_ALLOC)
- @@ -8515,10 +8516,11 @@ S_is_inplace_av(pTHX_ OP *o, OP *oright) {
- * peep() is called */
- void
- -Perl_peep(pTHX_ register OP *o)
- +Perl_peep(pTHX_ register OP *o, void *_next)
- {
- dVAR;
- register OP* oldop = NULL;
- + peep_t next_peep = (peep_t)_next;
- if (!o || o->op_opt)
- return;
- @@ -8714,7 +8716,7 @@ Perl_peep(pTHX_ register OP *o)
- sop = fop->op_sibling;
- while (cLOGOP->op_other->op_type == OP_NULL)
- cLOGOP->op_other = cLOGOP->op_other->op_next;
- - peep(cLOGOP->op_other); /* Recursive calls are not replaced by fptr calls */
- + CALL_A_PEEP(next_peep, cLOGOP->op_other); /* Recursive calls are not replaced by fptr calls */
- stitch_keys:
- o->op_opt = 1;
- @@ -8765,20 +8767,20 @@ Perl_peep(pTHX_ register OP *o)
- case OP_ONCE:
- while (cLOGOP->op_other->op_type == OP_NULL)
- cLOGOP->op_other = cLOGOP->op_other->op_next;
- - peep(cLOGOP->op_other); /* Recursive calls are not replaced by fptr calls */
- + CALL_A_PEEP(next_peep, cLOGOP->op_other); /* Recursive calls are not replaced by fptr calls */
- break;
- case OP_ENTERLOOP:
- case OP_ENTERITER:
- while (cLOOP->op_redoop->op_type == OP_NULL)
- cLOOP->op_redoop = cLOOP->op_redoop->op_next;
- - peep(cLOOP->op_redoop);
- + CALL_A_PEEP(next_peep, cLOOP->op_redoop);
- while (cLOOP->op_nextop->op_type == OP_NULL)
- cLOOP->op_nextop = cLOOP->op_nextop->op_next;
- - peep(cLOOP->op_nextop);
- + CALL_A_PEEP(next_peep, cLOOP->op_nextop);
- while (cLOOP->op_lastop->op_type == OP_NULL)
- cLOOP->op_lastop = cLOOP->op_lastop->op_next;
- - peep(cLOOP->op_lastop);
- + CALL_A_PEEP(next_peep, cLOOP->op_lastop);
- break;
- case OP_SUBST:
- @@ -8787,7 +8789,7 @@ Perl_peep(pTHX_ register OP *o)
- cPMOP->op_pmstashstartu.op_pmreplstart->op_type == OP_NULL)
- cPMOP->op_pmstashstartu.op_pmreplstart
- = cPMOP->op_pmstashstartu.op_pmreplstart->op_next;
- - peep(cPMOP->op_pmstashstartu.op_pmreplstart);
- + CALL_A_PEEP(next_peep, cPMOP->op_pmstashstartu.op_pmreplstart);
- break;
- case OP_EXEC:
- diff --git a/perl.h b/perl.h
- index 7fcff2f..31b7107 100644
- --- a/perl.h
- +++ b/perl.h
- @@ -4833,7 +4833,7 @@ struct perl_debug_pad {
- PERL_DEBUG_PAD(i))
- /* Enable variables which are pointers to functions */
- -typedef void (CPERLscope(*peep_t))(pTHX_ OP* o);
- +typedef void (CPERLscope(*peep_t))(pTHX_ OP* o, void *next);
- typedef regexp*(CPERLscope(*regcomp_t)) (pTHX_ char* exp, char* xend, PMOP* pm);
- typedef I32 (CPERLscope(*regexec_t)) (pTHX_ regexp* prog, char* stringarg,
- char* strend, char* strbeg, I32 minend,
- diff --git a/proto.h b/proto.h
- index 8ad7e66..4406951 100644
- --- a/proto.h
- +++ b/proto.h
- @@ -2570,7 +2570,11 @@ PERL_CALLCONV void Perl_pad_free(pTHX_ PADOFFSET po);
- STATIC void S_pad_reset(pTHX);
- #endif
- PERL_CALLCONV void Perl_pad_swipe(pTHX_ PADOFFSET po, bool refadjust);
- -PERL_CALLCONV void Perl_peep(pTHX_ OP* o);
- +PERL_CALLCONV void Perl_peep(pTHX_ OP* o, void *next)
- + __attribute__nonnull__(pTHX_2);
- +#define PERL_ARGS_ASSERT_PEEP \
- + assert(next)
- +
- PERL_CALLCONV PerlIO* Perl_start_glob(pTHX_ SV *tmpglob, IO *io)
- __attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_2);