diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-09-22 16:01:48 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-09-22 16:01:48 +0000 |
commit | b83535cb553b94cd457aaceadbc320b293a81b7c (patch) | |
tree | fcdecfade8ccfb2652c468f025c4bc3a32791f49 /sv.c | |
parent | d9f997d712a9ca9f2b66409f2920290ddaf904c3 (diff) | |
download | perl-b83535cb553b94cd457aaceadbc320b293a81b7c.tar.gz |
runops becomes a funtion pointer and sv_bless3 created
to avoid pointer forgery with '~'-magic.
p4raw-id: //depot/perl@68
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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; |