From: Artur Bergman Date: Tue, 23 Oct 2001 19:39:24 +0000 (+0000) Subject: Change #12607 introduced a bug, seems like some MAGICAL SVs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1edbfb88dca645450f44e4bcbb3df8372f66c904;p=p5sagit%2Fp5-mst-13.2.git Change #12607 introduced a bug, seems like some MAGICAL SVs don't call themselves READONLY but still die with modification attempt. We only call bless for ext and umagic. p4raw-id: //depot/perl@12610 --- diff --git a/sv.c b/sv.c index ecf86e5..44a114b 100644 --- a/sv.c +++ b/sv.c @@ -7205,7 +7205,11 @@ Perl_sv_bless(pTHX_ SV *sv, HV *stash) else SvAMAGIC_off(sv); - SvSETMAGIC(tmpRef); + if(SvSMAGICAL(tmpRef)) + if(mg_find(tmpRef, PERL_MAGIC_ext) || mg_find(tmpRef, PERL_MAGIC_uvar)) + mg_set(tmpRef); + + return sv; }