diff options
author | Brandon Black <blblack@gmail.com> | 2007-05-29 14:08:13 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-05-30 15:21:10 +0000 |
commit | 2c7f4b87d1721d033cf5fc3b5a553f25a8d8485f (patch) | |
tree | 430444390cb3e068f0568931793ceb10a9e48aef /mro.c | |
parent | 46c458a0aac497162070e892c9801b12c9c3ac48 (diff) | |
download | perl-2c7f4b87d1721d033cf5fc3b5a553f25a8d8485f.tar.gz |
Re: HvMROMETA
From: "Brandon Black" <blblack@gmail.com>
Message-ID: <84621a60705291708m3f106d74r473f3d91c780163d@mail.gmail.com>
p4raw-id: //depot/perl@31312
Diffstat (limited to 'mro.c')
-rw-r--r-- | mro.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -411,8 +411,10 @@ AV* Perl_mro_get_linear_isa(pTHX_ HV *stash) { struct mro_meta* meta; + assert(stash); - assert(HvAUX(stash)); + if(!SvOOK(stash)) + Perl_croak(aTHX_ "Can't linearize anonymous symbol table"); meta = HvMROMETA(stash); if(meta->mro_which == MRO_DFS) { @@ -444,12 +446,16 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash) SV** svp; I32 items; bool is_universal; + struct mro_meta * meta; const char * const stashname = HvNAME_get(stash); const STRLEN stashname_len = HvNAMELEN_get(stash); + if(!stashname) + Perl_croak(aTHX_ "Can't call mro_isa_changed_in() on anonymous symbol table"); + /* wipe out the cached linearizations for this stash */ - struct mro_meta * const meta = HvMROMETA(stash); + meta = HvMROMETA(stash); SvREFCNT_dec((SV*)meta->mro_linear_dfs); SvREFCNT_dec((SV*)meta->mro_linear_c3); meta->mro_linear_dfs = NULL; @@ -577,6 +583,9 @@ Perl_mro_method_changed_in(pTHX_ HV *stash) SV ** const svp = hv_fetch(PL_isarev, stashname, stashname_len, 0); HV * const isarev = svp ? (HV*)*svp : NULL; + if(!stashname) + Perl_croak(aTHX_ "Can't call mro_method_changed_in() on anonymous symbol table"); + /* Inc the package generation, since a local method changed */ HvMROMETA(stash)->pkg_gen++; |