summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-09-29 16:57:23 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-09-29 16:57:23 +0000
commit2ddcc7aa6c936ba8e7a9703319dfd8959bb54574 (patch)
treeb71ca26eb63d153ac3532c533e89b09266239001 /sv.c
parent8f95159f0f6f551c08c5f6e1a4d8807b332bc21a (diff)
downloadperl-2ddcc7aa6c936ba8e7a9703319dfd8959bb54574.tar.gz
Re-introduce the changes from change 68 (runops becomes a
function pointer and sv_bless3 for '~'-magic) which got lost during the preparation for the maint-merge. p4raw-id: //depot/perl@78
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index cd55f817e6..1c58c46aaa 100644
--- a/sv.c
+++ b/sv.c
@@ -4043,9 +4043,10 @@ I32 n;
}
SV*
-sv_bless(sv,stash)
+sv_bless3(sv,stash,zaptilde)
SV* sv;
HV* stash;
+bool zaptilde;
{
dTHR;
SV *ref;
@@ -4058,6 +4059,8 @@ HV* stash;
if (SvOBJECT(ref)) {
if (SvTYPE(ref) != SVt_PVIO)
--sv_objcount;
+ if (zaptilde && SvRMAGICAL(ref))
+ sv_unmagic(ref, '~'); /* stop cross-class pointer forgery */
SvREFCNT_dec(SvSTASH(ref));
}
}
@@ -4077,6 +4080,14 @@ HV* stash;
return sv;
}
+SV*
+sv_bless(sv,stash)
+SV* sv;
+HV* stash;
+{
+ return sv_bless3(sv, stash, FALSE);
+}
+
static void
sv_unglob(sv)
SV* sv;