summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorOwen Taylor <owt1@cornell.edu>1997-11-26 19:25:50 -0500
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-27 15:01:37 +0000
commit51cf62d8ec31d46fecbc8564c5b48c17f5776f7f (patch)
tree77b98ec3783c3cd157eaf5f73d37a974e39f804d /sv.c
parentfac76ed70b2818d69c47c57bd5b63a636a19a037 (diff)
downloadperl-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.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 77feae2fc3..649f623ae7 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);