From: Florian Ragwitz Date: Fri, 5 Dec 2008 06:21:02 +0000 (+0000) Subject: Fail if hv_store fails. X-Git-Tag: 0.71_02~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7291ecef63b1273c2338398847764452f5ffa827;p=gitmo%2FClass-MOP.git Fail if hv_store fails. --- diff --git a/MOP.xs b/MOP.xs index 2a3e49b..9be66a1 100644 --- a/MOP.xs +++ b/MOP.xs @@ -128,7 +128,9 @@ get_all_package_symbols(HV *stash, type_filter_t filter) while ( (he = hv_iternext(stash)) ) { STRLEN keylen; char *key = HePV(he, keylen); - hv_store(ret, key, keylen, SvREFCNT_inc(HeVAL(he)), 0); + if (!hv_store(ret, key, keylen, SvREFCNT_inc(HeVAL(he)), 0)) { + croak("failed to store glob ref"); + } } return ret; @@ -183,7 +185,9 @@ get_all_package_symbols(HV *stash, type_filter_t filter) if (sv) { char *key = HePV(he, keylen); - hv_store(ret, key, keylen, newRV_inc(sv), 0); + if (!hv_store(ret, key, keylen, newRV_inc(sv), 0)) { + croak("failed to store symbol ref"); + } } }