summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-28 11:27:46 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-28 11:27:46 +0000
commita3f914c54a06647534c0855205d45eb950aebdd4 (patch)
tree8bada15a2dcc58072ddcdefbe9a64796f0017be0 /pp.c
parent60ad88b8fe9480f2f097fca26f4f3a9f83a4f830 (diff)
downloadperl-a3f914c54a06647534c0855205d45eb950aebdd4.tar.gz
make $1 et al readonly under threads; make C<undef $1> fail like
C<$1 = undef> does p4raw-id: //depot/perl@2335
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 2686116698..07b83dba3d 100644
--- a/pp.c
+++ b/pp.c
@@ -762,8 +762,11 @@ PP(pp_undef)
RETPUSHUNDEF;
if (SvTHINKFIRST(sv)) {
- if (SvREADONLY(sv))
- RETPUSHUNDEF;
+ if (SvREADONLY(sv)) {
+ dTHR;
+ if (PL_curcop != &PL_compiling)
+ croak(PL_no_modify);
+ }
if (SvROK(sv))
sv_unref(sv);
}