From: Vincent Pit Date: Tue, 18 Aug 2015 13:53:27 +0000 (-0300) Subject: Don't hardcode the length of NEGATIVE_INDICES_VAR X-Git-Tag: v0.28~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=5d8cdf312bfa4dfd115c15b30b8fcb2d35c5ae88;p=perl%2Fmodules%2FScope-Upper.git Don't hardcode the length of NEGATIVE_INDICES_VAR --- diff --git a/Upper.xs b/Upper.xs index 823b32e..01d0270 100644 --- a/Upper.xs +++ b/Upper.xs @@ -576,9 +576,10 @@ static I32 su_av_key2idx(pTHX_ AV *av, I32 key) { if (SvRMAGICAL(av)) { const MAGIC * const tied_magic = mg_find((SV *) av, PERL_MAGIC_tied); if (tied_magic) { - SV * const * const negative_indices_glob = - hv_fetch(SvSTASH(SvRV(SvTIED_obj((SV *) (av), tied_magic))), - NEGATIVE_INDICES_VAR, 16, 0); + SV * const * const negative_indices_glob = hv_fetch( + SvSTASH(SvRV(SvTIED_obj((SV *) (av), tied_magic))), + NEGATIVE_INDICES_VAR, sizeof(NEGATIVE_INDICES_VAR)-1, 0 + ); if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob))) return key; }