This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix bug #41550 - AUTOLOAD :lvalue not working the same in blead as in
[perl5.git] / pp_hot.c
index 5cd01be..aa225c3 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1944,8 +1944,7 @@ PP(pp_iter)
        if (lv)
            SvREFCNT_dec(LvTARG(lv));
        else {
-           lv = cx->blk_loop.iterlval = newSV(0);
-           sv_upgrade(lv, SVt_PVLV);
+           lv = cx->blk_loop.iterlval = newSV_type(SVt_PVLV);
            LvTYPE(lv) = 'y';
            sv_magic(lv, NULL, PERL_MAGIC_defelem, NULL, 0);
        }