This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove null check from mg.c:magic_getvec
authorFather Chrysostomos <sprout@cpan.org>
Fri, 26 Jul 2013 13:25:36 +0000 (06:25 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 22 Aug 2013 15:28:10 +0000 (08:28 -0700)
lsv can never be null here.  This null check has been here since
vec’s get-magic was added in ae389c8a or 6ff81951f7.

mg.c

diff --git a/mg.c b/mg.c
index 305817c..f18a98a 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -2284,10 +2284,7 @@ Perl_magic_getvec(pTHX_ SV *sv, MAGIC *mg)
     PERL_ARGS_ASSERT_MAGIC_GETVEC;
     PERL_UNUSED_ARG(mg);
 
-    if (lsv)
-       sv_setuv(sv, do_vecget(lsv, LvTARGOFF(sv), LvTARGLEN(sv)));
-    else
-       SvOK_off(sv);
+    sv_setuv(sv, do_vecget(lsv, LvTARGOFF(sv), LvTARGLEN(sv)));
 
     return 0;
 }