summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorLarry Wall <larry@netlabs.com>1993-12-10 00:00:00 +0000
committerLarry Wall <larry@netlabs.com>1993-12-10 00:00:00 +0000
commited6116ce9b9d13712ea252ee248b0400653db7f9 (patch)
tree348e8de37401fa4381f6bfe0989abef2e3b409e0 /doop.c
parent9bbf408117c16189b372e6657c9e5a15d01ea504 (diff)
downloadperl-ed6116ce9b9d13712ea252ee248b0400653db7f9.tar.gz
perl 5.0 alpha 5
[editor's note: the sparc executables have not been included, and emacs backup files and other cruft such as patch backup files have been removed. This was reconstructed from a tarball found on the September 1994 InfoMagic CD]
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/doop.c b/doop.c
index fa43e3750c..146bd24393 100644
--- a/doop.c
+++ b/doop.c
@@ -421,8 +421,12 @@ register SV *sv;
if (!sv)
return;
- if (SvREADONLY(sv))
- croak("Can't chop readonly value");
+ if (SvTHINKFIRST(sv)) {
+ if (SvREADONLY(sv))
+ croak("Can't chop readonly value");
+ if (SvROK(sv))
+ sv_unref(sv);
+ }
if (SvTYPE(sv) == SVt_PVAV) {
I32 max;
SV **array = AvARRAY(sv);
@@ -471,8 +475,12 @@ SV *right;
register char *rc = SvPV(right, rightlen);
register I32 len;
- if (SvREADONLY(sv))
- croak("Can't do %s to readonly value", op_name[optype]);
+ if (SvTHINKFIRST(sv)) {
+ if (SvREADONLY(sv))
+ croak("Can't do %s to readonly value", op_name[optype]);
+ if (SvROK(sv))
+ sv_unref(sv);
+ }
len = leftlen < rightlen ? leftlen : rightlen;
if (SvTYPE(sv) < SVt_PV)
sv_upgrade(sv, SVt_PV);