From: Jarkko Hietaniemi Date: Fri, 13 Oct 2000 02:31:47 +0000 (+0000) Subject: Self-ties are unsupported currently, stopgap patch from Alan Burlison. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=68a4a7e45ed01889c35c30188ba30508bfc1e5b5;p=p5sagit%2Fp5-mst-13.2.git Self-ties are unsupported currently, stopgap patch from Alan Burlison. p4raw-id: //depot/perl@7213 --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 63d7f99..c4d2654 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2899,6 +2899,10 @@ filehandle that was either never opened or has since been closed. (F) This machine doesn't implement the select() system call. +=item Self-ties are not supported + +(F) Self-ties are not supported in the current implementation. + =item Semicolon seems to be missing (W semicolon) A nearby syntax error was probably caused by a missing diff --git a/pp_sys.c b/pp_sys.c index 5fa86d6..9329ffd 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -794,7 +794,10 @@ PP(pp_tie) POPSTACK; if (sv_isobject(sv)) { sv_unmagic(varsv, how); - sv_magic(varsv, (SvRV(sv) == varsv ? Nullsv : sv), how, Nullch, 0); + /* Croak if a self-tie is attempted */ + if (varsv == SvRV(sv)) + Perl_croak(aTHX_ "Self-ties are not supported"); + sv_magic(varsv, sv, how, Nullch, 0); } LEAVE; SP = PL_stack_base + markoff;