This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate SVt_RV, and use SVt_IV to store plain references.
[perl5.git] / pp.c
diff --git a/pp.c b/pp.c
index 349e91f..08ebe5e 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -172,8 +172,8 @@ PP(pp_rv2gv)
                        const char * const name = CopSTASHPV(PL_curcop);
                        gv = newGVgen(name);
                    }
-                   if (SvTYPE(sv) < SVt_RV || SvTYPE(sv) == SVt_NV)
-                       sv_upgrade(sv, SVt_RV);
+                   if (SvTYPE(sv) < SVt_PV && SvTYPE(sv) != SVt_IV)
+                       sv_upgrade(sv, SVt_IV);
                    else if (SvPVX_const(sv)) {
                        SvPV_free(sv);
                        SvLEN_set(sv, 0);
@@ -536,7 +536,7 @@ S_refto(pTHX_ SV *sv)
        SvREFCNT_inc_void_NN(sv);
     }
     rv = sv_newmortal();
-    sv_upgrade(rv, SVt_RV);
+    sv_upgrade(rv, SVt_IV);
     SvRV_set(rv, sv);
     SvROK_on(rv);
     return rv;