From: Jesse Luehrs Date: Sat, 25 Apr 2009 00:43:45 +0000 (-0500) Subject: return early if a package's stash is empty in get_method_map X-Git-Tag: 0.83~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d7bb08d65644b176de8fe019cea5a1b8e26d8769;p=gitmo%2FClass-MOP.git return early if a package's stash is empty in get_method_map --- diff --git a/xs/Class.xs b/xs/Class.xs index 32bbde6..5bd9fae 100644 --- a/xs/Class.xs +++ b/xs/Class.xs @@ -88,6 +88,9 @@ get_method_map(self) HV *const obj = (HV *)SvRV(self); SV *const class_name = HeVAL( hv_fetch_ent(obj, KEY_FOR(package), 0, HASH_FOR(package)) ); HV *const stash = gv_stashsv(class_name, 0); + if (!stash) { + return; + } UV const current = mop_check_package_cache_flag(aTHX_ stash); SV *const cache_flag = HeVAL( hv_fetch_ent(obj, KEY_FOR(package_cache_flag), TRUE, HASH_FOR(package_cache_flag))); SV *const map_ref = HeVAL( hv_fetch_ent(obj, KEY_FOR(methods), TRUE, HASH_FOR(methods)));