From: Owen Taylor Date: Thu, 27 Nov 1997 00:25:50 +0000 (-0500) Subject: Fix newSVrv so sv_setref_foo work better: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=51cf62d8ec31d46fecbc8564c5b48c17f5776f7f;p=p5sagit%2Fp5-mst-13.2.git Fix newSVrv so sv_setref_foo work better: Subject: [PATCH] [5.004_55] newSVrv (again) p4raw-id: //depot/perl@319 --- diff --git a/sv.c b/sv.c index 77feae2..649f623 100644 --- a/sv.c +++ b/sv.c @@ -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);