This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_leavesublv(): croak on *all* PADTMPs
[perl5.git] / pp_ctl.c
index c81df19..b49f86d 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2337,8 +2337,7 @@ PP(pp_leavesublv)
     if (gimme == G_SCALAR) {
        if (CxLVAL(cx) && !ref) {     /* Leave it as it is if we can. */
            if (MARK <= SP) {
-               if ((SvPADTMP(TOPs) || SvREADONLY(TOPs)) &&
-                   !SvSMAGICAL(TOPs)) {
+               if ((SvPADTMP(TOPs) || SvREADONLY(TOPs))) {
                    what =
                        SvREADONLY(TOPs) ? (TOPs == &PL_sv_undef) ? "undef"
                        : "a readonly value" : "a temporary";