diff options
-rw-r--r-- | embed.fnc | 4 | ||||
-rw-r--r-- | pod/perldelta.pod | 9 | ||||
-rw-r--r-- | pp_ctl.c | 14 | ||||
-rw-r--r-- | proto.h | 9 | ||||
-rw-r--r-- | regcomp.c | 2 |
5 files changed, 35 insertions, 3 deletions
@@ -1174,7 +1174,9 @@ Apd |I32 |sv_cmp_locale_flags |NULLOK SV *const sv1 \ Amd |char* |sv_collxfrm |NN SV *const sv|NN STRLEN *const nxp Apd |char* |sv_collxfrm_flags |NN SV *const sv|NN STRLEN *const nxp|I32 const flags #endif -Ap |OP* |sv_compile_2op |NN SV *sv|NN OP **startop \ +po |OP* |sv_compile_2op_is_broken|NN SV *sv|NN OP **startop \ + |NN const char *code|NN PAD **padp +ApD |OP* |sv_compile_2op |NN SV *sv|NN OP **startop \ |NN const char *code|NN PAD **padp Apd |int |getcwd_sv |NN SV* sv Apd |void |sv_dec |NULLOK SV *const sv diff --git a/pod/perldelta.pod b/pod/perldelta.pod index b1da9b8f03..624e4f5c63 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -53,6 +53,15 @@ listed as an updated module in the L</Modules and Pragmata> section. [ List each deprecation as a =head2 entry ] +=head2 C<sv_compile_2op> is now deprecated + +The C<sv_compile_2op> is now deprecated, and will be removed. Searches suggest +that nothing on CPAN is using it, so this should have zero impact. + +It attempted to provide an API to compile code down to an optree, but failed +to bind correctly to lexicals in the enclosing scope. It's not possible to +fix this problem within the constraints of its parameters and return value. + =head1 Performance Enhancements XXX Changes which enhance performance without changing behaviour go here. There @@ -2982,6 +2982,8 @@ S_docatch(pTHX_ OP *o) called more than once, and is only used by regcomp.c, for (?{}) blocks. Currently it is not used outside the core code. Best if it stays that way. + + Hence it's now deprecated, and will be removed. */ OP * Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const char *code, PAD** padp) @@ -2989,6 +2991,16 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const char *code, PAD** padp) /* startop op_free() this to undo. */ /* code Short string id of the caller. */ { + PERL_ARGS_ASSERT_SV_COMPILE_2OP; + return Perl_sv_compile_2op_is_broken(aTHX_ sv, startop, code, padp); +} + +/* Don't use this. It will go away without warning once the regexp engine is + refactored not to use it. */ +OP * +Perl_sv_compile_2op_is_broken(pTHX_ SV *sv, OP **startop, const char *code, + PAD **padp) +{ dVAR; dSP; /* Make POPBLOCK work. */ PERL_CONTEXT *cx; SV **newsp; @@ -3003,7 +3015,7 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const char *code, PAD** padp) STRLEN len; bool need_catch; - PERL_ARGS_ASSERT_SV_COMPILE_2OP; + PERL_ARGS_ASSERT_SV_COMPILE_2OP_IS_BROKEN; ENTER_with_name("eval"); lex_start(sv, NULL, 0); @@ -4020,6 +4020,7 @@ PERL_CALLCONV I32 Perl_sv_cmp_flags(pTHX_ SV *const sv1, SV *const sv2, const U3 PERL_CALLCONV I32 Perl_sv_cmp_locale(pTHX_ SV *const sv1, SV *const sv2); PERL_CALLCONV I32 Perl_sv_cmp_locale_flags(pTHX_ SV *const sv1, SV *const sv2, const U32 flags); PERL_CALLCONV OP* Perl_sv_compile_2op(pTHX_ SV *sv, OP **startop, const char *code, PAD **padp) + __attribute__deprecated__ __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) __attribute__nonnull__(pTHX_3) @@ -4027,6 +4028,14 @@ PERL_CALLCONV OP* Perl_sv_compile_2op(pTHX_ SV *sv, OP **startop, const char *co #define PERL_ARGS_ASSERT_SV_COMPILE_2OP \ assert(sv); assert(startop); assert(code); assert(padp) +PERL_CALLCONV OP* Perl_sv_compile_2op_is_broken(pTHX_ SV *sv, OP **startop, const char *code, PAD **padp) + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_2) + __attribute__nonnull__(pTHX_3) + __attribute__nonnull__(pTHX_4); +#define PERL_ARGS_ASSERT_SV_COMPILE_2OP_IS_BROKEN \ + assert(sv); assert(startop); assert(code); assert(padp) + PERL_CALLCONV void Perl_sv_copypv(pTHX_ SV *const dsv, SV *const ssv) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); @@ -6074,7 +6074,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) ENTER; Perl_save_re_context(aTHX); - rop = sv_compile_2op(sv, &sop, "re", &pad); + rop = Perl_sv_compile_2op_is_broken(aTHX_ sv, &sop, "re", &pad); sop->op_private |= OPpREFCOUNTED; /* re_dup will OpREFCNT_inc */ OpREFCNT_set(sop, 1); |