diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-25 20:43:10 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-25 20:43:10 +0000 |
commit | ae21d580cc4565c4ab54286c723cd431c96dedeb (patch) | |
tree | 75307a26aea8814ec350fd7a2de3e95d878a1f63 /pp_sys.c | |
parent | 8dcd6f7b32c170bcf62c1187a3413da9a3cdf97a (diff) | |
download | perl-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.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; |