summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/pad.c b/pad.c
index c0098bedf3..7854678928 100644
--- a/pad.c
+++ b/pad.c
@@ -2127,7 +2127,6 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside, HV *cloned,
* from the parent */
if (const_sv && SvREFCNT(const_sv) == 2) {
const bool was_method = cBOOL(CvMETHOD(cv));
- bool copied = FALSE;
if (outside) {
PADNAME * const pn =
PadlistNAMESARRAY(CvPADLIST(outside))
@@ -2156,28 +2155,15 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside, HV *cloned,
) == o
&& !OpSIBLING(o))
{
- Perl_ck_warner_d(aTHX_
- packWARN(WARN_DEPRECATED),
- "Constants from lexical "
- "variables potentially "
- "modified elsewhere are "
- "deprecated. This will not "
- "be allowed in Perl 5.32");
- /* We *copy* the lexical variable, and donate the
- copy to newCONSTSUB. Yes, this is ugly, and
- should be killed. We need to do this for the
- time being, however, because turning on SvPADTMP
- on a lexical will have observable effects
- elsewhere. */
- const_sv = newSVsv(const_sv);
- copied = TRUE;
+ Perl_croak(aTHX_
+ "Constants from lexical variables potentially modified "
+ "elsewhere are no longer permitted");
}
else
goto constoff;
}
}
- if (!copied)
- SvREFCNT_inc_simple_void_NN(const_sv);
+ SvREFCNT_inc_simple_void_NN(const_sv);
/* If the lexical is not used elsewhere, it is safe to turn on
SvPADTMP, since it is only when it is used in lvalue con-
text that the difference is observable. */