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
[ 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
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)
/* 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;
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);
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)
#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);
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);