From bee7c5743fabd49c584c5edbb637c66c5c25ca9a Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 18 May 2012 17:02:39 -0700 Subject: [PATCH] =?utf8?q?sv.c:=20Don=E2=80=99t=20fiddle=20with=20AMAGIC?= =?utf8?q?=20in=20sv=5Fbless?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since overloading itself now checks whether caches are up to date, and since changes to the stash (@ISA, methods) turn the flag on and over- loading itself turns the flag off when it can, sv_bless no longer needs to deal with it at all. --- lib/overload.t | 4 ++-- sv.c | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/overload.t b/lib/overload.t index 390ffab..104b7c4 100644 --- a/lib/overload.t +++ b/lib/overload.t @@ -2191,7 +2191,7 @@ fresh_perl_is { package Justus; use overload '+' => 'justice'; - eval {bless[]}; + eval {"".bless[]}; ::like $@, qr/^Can't resolve method "justice" overloading "\+" in p(?x: )ackage "Justus" at /, 'Error message when explicitly named overload method does not exist'; @@ -2200,7 +2200,7 @@ fresh_perl_is our @ISA = 'JustYou'; package JustYou { use overload '+' => 'injustice'; } "JustUs"->${\"(+"}; - eval {bless []}; + eval {"".bless []}; ::like $@, qr/^Stub found while resolving method "\?{3}" overloadin(?x: )g "\+" in package "JustUs" at /, 'Error message when sub stub is encountered'; diff --git a/sv.c b/sv.c index 0c940cb..1e7f4d2 100644 --- a/sv.c +++ b/sv.c @@ -9518,11 +9518,6 @@ Perl_sv_bless(pTHX_ SV *const sv, HV *const stash) SvUPGRADE(tmpRef, SVt_PVMG); SvSTASH_set(tmpRef, MUTABLE_HV(SvREFCNT_inc_simple(stash))); - if (Gv_AMG(stash)) - SvAMAGIC_on(sv); - else - (void)SvAMAGIC_off(sv); - if(SvSMAGICAL(tmpRef)) if(mg_find(tmpRef, PERL_MAGIC_ext) || mg_find(tmpRef, PERL_MAGIC_uvar)) mg_set(tmpRef); -- 2.7.4