In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c290e187228e365708b7d5a9ae53ad10c3c002c6?hp=d3ac2b769b5ecec58c3a4173895286445c881f8a>

- Log -----------------------------------------------------------------
commit c290e187228e365708b7d5a9ae53ad10c3c002c6
Author: syber <sy...@crazypanda.ru>
Date:   Tue Dec 9 01:36:23 2014 +0300

    Fix gv_fetchmeth_sv: it might stringify SV more than once.
-----------------------------------------------------------------------

Summary of changes:
 gv.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gv.c b/gv.c
index 96e07da..6801816 100644
--- a/gv.c
+++ b/gv.c
@@ -636,8 +636,14 @@ of an SV instead of a string/length pair.
 GV *
 Perl_gv_fetchmeth_sv(pTHX_ HV *stash, SV *namesv, I32 level, U32 flags)
 {
-   PERL_ARGS_ASSERT_GV_FETCHMETH_SV;
-   return gv_fetchmeth_internal(stash, namesv, NULL, 0, level, flags);
+    char *namepv;
+    STRLEN namelen;
+    PERL_ARGS_ASSERT_GV_FETCHMETH_SV;
+    if (LIKELY(SvPOK_nog(namesv))) /* common case */
+        return gv_fetchmeth_internal(stash, namesv, NULL, 0, level, flags);
+    namepv = SvPV(namesv, namelen);
+    if (SvUTF8(namesv)) flags |= SVf_UTF8;
+    return gv_fetchmeth_pvn(stash, namepv, namelen, level, flags);
 }
 
 /*

--
Perl5 Master Repository

Reply via email to