summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-10-25 20:43:10 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-25 20:43:10 +0000
commitae21d580cc4565c4ab54286c723cd431c96dedeb (patch)
tree75307a26aea8814ec350fd7a2de3e95d878a1f63 /pp_sys.c
parent8dcd6f7b32c170bcf62c1187a3413da9a3cdf97a (diff)
downloadperl-ae21d580cc4565c4ab54286c723cd431c96dedeb.tar.gz
Temporary stopgap for the self-tying issue: for now only
array and hash self-ties are verboten. The real fix, of course, would be to comprehensively test (and implement?) and debug (and document) self-ties. p4raw-id: //depot/perl@7443
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pp_sys.c b/pp_sys.c
index c7cbd460db..28ffcda5e1 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -802,9 +802,12 @@ PP(pp_tie)
POPSTACK;
if (sv_isobject(sv)) {
sv_unmagic(varsv, how);
- /* Croak if a self-tie is attempted */
- if (varsv == SvRV(sv))
- Perl_croak(aTHX_ "Self-ties are not supported");
+ /* Croak if a self-tie on an aggregate is attempted. */
+ if (varsv == SvRV(sv) &&
+ (SvTYPE(sv) == SVt_PVAV ||
+ SvTYPE(sv) == SVt_PVHV))
+ Perl_croak(aTHX_
+ "Self-ties of arrays and hashes are not supported");
sv_magic(varsv, sv, how, Nullch, 0);
}
LEAVE;