diff options
author | Owen Taylor <owt1@cornell.edu> | 1997-11-26 19:25:50 -0500 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-11-27 15:01:37 +0000 |
commit | 51cf62d8ec31d46fecbc8564c5b48c17f5776f7f (patch) | |
tree | 77b98ec3783c3cd157eaf5f73d37a974e39f804d /sv.c | |
parent | fac76ed70b2818d69c47c57bd5b63a636a19a037 (diff) | |
download | perl-51cf62d8ec31d46fecbc8564c5b48c17f5776f7f.tar.gz |
Fix newSVrv so sv_setref_foo work better:
Subject: [PATCH] [5.004_55] newSVrv (again)
p4raw-id: //depot/perl@319
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -3883,7 +3883,16 @@ newSVrv(SV *rv, char *classname) SvANY(sv) = 0; SvREFCNT(sv) = 0; SvFLAGS(sv) = 0; - sv_upgrade(rv, SVt_RV); + + sv_check_thinkfirst(rv); +#ifdef OVERLOAD + SvAMAGIC_off(rv); +#endif /* OVERLOAD */ + + if (SvTYPE(rv) < SVt_RV) + sv_upgrade(rv, SVt_RV); + + (void)SvOK_off(rv); SvRV(rv) = SvREFCNT_inc(sv); SvROK_on(rv); |