summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2006-01-02 12:09:37 +0000
committerDave Mitchell <davem@fdisolutions.com>2006-01-02 12:09:37 +0000
commita5063e7cd8fef802efd25ffe9df2c3748f4254f6 (patch)
treed64839134e7ea4472187ba4d6b88f6dcaea8b65f /mg.c
parent7e35a1b7e6a7c6685061284278f26171e0070f33 (diff)
downloadperl-a5063e7cd8fef802efd25ffe9df2c3748f4254f6.tar.gz
add svt_local slot to magic vtable, and fix local $shared
p4raw-id: //depot/perl@26569
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mg.c b/mg.c
index 703a876ee3..3478b410dc 100644
--- a/mg.c
+++ b/mg.c
@@ -430,15 +430,12 @@ Perl_mg_localize(pTHX_ SV *sv, SV *nsv)
continue;
}
- if ((mg->mg_flags & MGf_COPY) && vtbl->svt_copy) {
- /* XXX calling the copy method is probably not correct. DAPM */
- (void)CALL_FPTR(vtbl->svt_copy)(aTHX_ sv, mg, nsv,
- mg->mg_ptr, mg->mg_len);
- }
- else {
+ if ((mg->mg_flags & MGf_LOCAL) && vtbl->svt_local)
+ (void)CALL_FPTR(vtbl->svt_local)(aTHX_ nsv, mg);
+ else
sv_magicext(nsv, mg->mg_obj, mg->mg_type, vtbl,
mg->mg_ptr, mg->mg_len);
- }
+
/* container types should remain read-only across localization */
SvFLAGS(nsv) |= SvREADONLY(sv);
}