summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Wall <lwall@scalpel.netlabs.com>1995-01-11 11:01:09 -0800
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-01-11 19:01:09 +0000
commitd23b30860e3e4c1bd7e12ed5a35d1b90e7fa214c (patch)
treece09f650adcc4f1aa293310308802d67274ef1e2
parentecfc54246c2a6f42dc95b17a964a6048192067d2 (diff)
downloadperl-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.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 63dfa71147..7776aa631d 100644
--- a/sv.c
+++ b/sv.c
@@ -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);
}