This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
If the scalar has just been upgraded to SVt_RV, there's no way SvPVX
authorNicholas Clark <nick@ccl4.org>
Mon, 20 Mar 2006 10:13:38 +0000 (10:13 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 20 Mar 2006 10:13:38 +0000 (10:13 +0000)
can be non-NULL, so no need to check.

p4raw-id: //depot/perl@27548

pp.c

diff --git a/pp.c b/pp.c
index 383b426..6b3ead8 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -172,7 +172,7 @@ PP(pp_rv2gv)
                    }
                    if (SvTYPE(sv) < SVt_RV)
                        sv_upgrade(sv, SVt_RV);
                    }
                    if (SvTYPE(sv) < SVt_RV)
                        sv_upgrade(sv, SVt_RV);
-                   if (SvPVX_const(sv)) {
+                   else if (SvPVX_const(sv)) {
                        SvPV_free(sv);
                        SvLEN_set(sv, 0);
                         SvCUR_set(sv, 0);
                        SvPV_free(sv);
                        SvLEN_set(sv, 0);
                         SvCUR_set(sv, 0);