In Perl_amagic_call(), construct the SV with newSVpvn(), as we now know
authorNicholas Clark <nick@ccl4.org>
Thu, 18 Oct 2007 16:15:22 +0000 (16:15 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 18 Oct 2007 16:15:22 +0000 (16:15 +0000)
the length. (Not sure why I didn't spot this one during change 32124.)

p4raw-id: //depot/perl@32132

gv.c
overload.c
overload.pl

diff --git a/gv.c b/gv.c
index a9eb65a..d34d043 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -2037,7 +2037,8 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
     PUSHs(lr>0? left: right);
     PUSHs( lr > 0 ? &PL_sv_yes : ( assign ? &PL_sv_undef : &PL_sv_no ));
     if (notfound) {
-      PUSHs( sv_2mortal(newSVpv(AMG_id2name(method + assignshift),0)));
+      PUSHs( sv_2mortal(newSVpvn(AMG_id2name(method + assignshift),
+                                AMG_id2namelen(method + assignshift))));
     }
     PUSHs((SV*)cv);
     PUTBACK;
index bb7f1cb..eaaef21 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #define AMG_id2name(id) (PL_AMG_names[id]+1)
+#define AMG_id2namelen(id) (PL_AMG_namelens[id]-1)
 
 const U8 PL_AMG_namelens[NofAMmeth] = {
     2,
index 6b1050e..a86222e 100644 (file)
@@ -70,6 +70,7 @@ EOF
 print C <<'EOF';
 
 #define AMG_id2name(id) (PL_AMG_names[id]+1)
+#define AMG_id2namelen(id) (PL_AMG_namelens[id]-1)
 
 const U8 PL_AMG_namelens[NofAMmeth] = {
 EOF