diff options
author | Larry Wall <lwall@scalpel.netlabs.com> | 1995-01-11 11:01:09 -0800 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1995-01-11 19:01:09 +0000 |
commit | d23b30860e3e4c1bd7e12ed5a35d1b90e7fa214c (patch) | |
tree | ce09f650adcc4f1aa293310308802d67274ef1e2 | |
parent | ecfc54246c2a6f42dc95b17a964a6048192067d2 (diff) | |
download | perl-d23b30860e3e4c1bd7e12ed5a35d1b90e7fa214c.tar.gz |
duplicate DESTROY
In order to fix the duplicate DESTROY bug, I need to remove [the
modified] lines from sv_setsv.
Basically, copying an object shouldn't produce another object without an
explicit blessing. I'm not sure if this will break anything. If Ilya
and anyone else so inclined would apply this patch and see if it breaks
anything related to overloading (or anything else object-oriented), I'd
be much obliged.
By the way, here's a test script for the duplicate DESTROY. You'll note
that it prints DESTROYED twice, once for , and once for . I don't
think an object should be considered an object unless viewed through
a reference. When accessed directly it should behave as a builtin type.
#!./perl
= new main;
= '';
sub new {
my ;
local /tmp/ssh-vaEzm16429/agent.16429 = bless $a;
local = ; # Bogusly makes an object.
/tmp/ssh-vaEzm16429/agent.16429;
}
sub DESTROY {
print "DESTROYED\n";
}
Larry
-rw-r--r-- | sv.c | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -1629,10 +1629,6 @@ register SV *sstr; else { (void)SvOK_off(dstr); } - if (SvOBJECT(sstr)) { - SvOBJECT_on(dstr); - SvSTASH(dstr) = (HV*)SvREFCNT_inc(SvSTASH(sstr)); - } SvTAINT(dstr); } |