diff options
author | Brandon Black <blblack@gmail.com> | 2007-06-26 06:05:31 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-06-26 16:10:11 +0000 |
commit | 9b43931120d41c17896bde0d0bb619d0e701b0ad (patch) | |
tree | eea82fc5a70e5740ca482eb453e3f26519bc2020 /gv.c | |
parent | 9708a845889d0a94d824aaba11ae342e024a4351 (diff) | |
download | perl-9b43931120d41c17896bde0d0bb619d0e701b0ad.tar.gz |
First patch from:
Subject: Re: [perl #43357] *DESTROY = sub {} at runtime
From: "Brandon Black" <blblack@gmail.com>
Message-ID: <84621a60706260905x2da6eaf1x4bd7d5223951e52@mail.gmail.com>
Fix problem recently introduced with loosing a DESTROY when redefined
at runtime.
p4raw-id: //depot/perl@31472
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1509,9 +1509,10 @@ Perl_Gv_AMupdate(pTHX_ HV *stash) dVAR; MAGIC* const mg = mg_find((SV*)stash, PERL_MAGIC_overload_table); AMT amt; + const struct mro_meta* stash_meta = HvMROMETA(stash); U32 newgen; - newgen = PL_sub_generation + HvMROMETA(stash)->cache_gen; + newgen = PL_sub_generation + stash_meta->pkg_gen + stash_meta->cache_gen; if (mg) { const AMT * const amtp = (AMT*)mg->mg_ptr; if (amtp->was_ok_am == PL_amagic_generation @@ -1638,11 +1639,13 @@ Perl_gv_handler(pTHX_ HV *stash, I32 id) MAGIC *mg; AMT *amtp; U32 newgen; + struct mro_meta* stash_meta; if (!stash || !HvNAME_get(stash)) return NULL; - newgen = PL_sub_generation + HvMROMETA(stash)->cache_gen; + stash_meta = HvMROMETA(stash); + newgen = PL_sub_generation + stash_meta->pkg_gen + stash_meta->cache_gen; mg = mg_find((SV*)stash, PERL_MAGIC_overload_table); if (!mg) { |