From: Florian Ragwitz Date: Thu, 4 Dec 2008 02:03:35 +0000 (+0000) Subject: Make the xs version of get_method_map include stub functions. X-Git-Tag: 0.71_01~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6bd19edb48b45c76562cd8163a8d546d57ff2c86;p=gitmo%2FClass-MOP.git Make the xs version of get_method_map include stub functions. --- diff --git a/MOP.xs b/MOP.xs index 11c888e..39e54b4 100644 --- a/MOP.xs +++ b/MOP.xs @@ -83,15 +83,27 @@ mop_update_method_map(pTHX_ SV* const self, SV* const class_name, HV* const stas GV* gv; dSP; + /* this function massivly overlaps with the xs version of + * get_all_package_symbols. a common c function to walk the symbol table + * should be factored out and used by both. --rafl */ + hv_iterinit(stash); while ( (gv = (GV*)hv_iternextsv(stash, &method_name, &method_name_len)) ) { CV* cv; - if ( SvROK(gv) ) { - /* rafl says that this wastes memory savings that GvSVs have - in 5.8.9 and 5.10.x. But without it some tests fail. rafl - says the right thing to do is to handle GvSVs differently - here. */ - gv_init((GV*)gv, stash, method_name, method_name_len, GV_ADDMULTI); + switch (SvTYPE (gv)) { + case SVt_RV: + if (!SvROK(gv)) { + break; + } + /* fall through */ + case SVt_IV: + case SVt_PV: + /* rafl says that this wastes memory savings that GvSVs have + in 5.8.9 and 5.10.x. But without it some tests fail. rafl + says the right thing to do is to handle GvSVs differently + here. */ + gv_init((GV*)gv, stash, method_name, method_name_len, GV_ADDMULTI); + /* fall through */ } if ( SvTYPE(gv) == SVt_PVGV && (cv = GvCVu(gv)) ) {