summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 3784350e3e..47869b1209 100644
--- a/sv.c
+++ b/sv.c
@@ -1949,11 +1949,14 @@ register SV *sstr;
(CvROOT(cv) || CvXSUB(cv)) )
warn("Subroutine %s redefined",
GvENAME((GV*)dstr));
- SvFAKE_on(cv);
+ if (SvREFCNT(cv) == 1)
+ SvFAKE_on(cv);
}
}
+ sub_generation++;
if (GvCV(dstr) != (CV*)sref) {
GvCV(dstr) = (CV*)sref;
+ GvCVGEN(dstr) = 0; /* Switch off cacheness. */
GvASSUMECV_on(dstr);
}
if (curcop->cop_stash != GvSTASH(dstr))
@@ -2077,7 +2080,7 @@ register SV *sstr;
void
sv_setpvn(sv,ptr,len)
register SV *sv;
-register char *ptr;
+register const char *ptr;
register STRLEN len;
{
assert(len >= 0); /* STRLEN is probably unsigned, so this may
@@ -2109,7 +2112,7 @@ register STRLEN len;
void
sv_setpv(sv,ptr)
register SV *sv;
-register char *ptr;
+register const char *ptr;
{
register STRLEN len;
@@ -2394,7 +2397,7 @@ I32 namlen;
mg->mg_virtual = &vtbl_substr;
break;
case 'y':
- mg->mg_virtual = &vtbl_vivary;
+ mg->mg_virtual = &vtbl_itervar;
break;
case '*':
mg->mg_virtual = &vtbl_glob;