Skip to content

Commit 8ed690e

Browse files
committed
pp_hot.c: Don't use signed char as an array index
The MingW compiler spotted this. The code prior to these uses already has made sure these indices are positive, so casting to unsigned works.
1 parent 6617266 commit 8ed690e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pp_hot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ PP(pp_aelemfastlex_store)
359359

360360
/* inlined av_fetch() for simple cases ... */
361361
if (!SvRMAGICAL(av) && key >=0 && key <= AvFILLp(av)) {
362-
targ = AvARRAY(av)[key];
362+
targ = AvARRAY(av)[ (U8) key ];
363363
}
364364
/* ... else do it the hard way */
365365
if (!targ) {
@@ -2033,7 +2033,7 @@ PP(pp_aelemfast)
20332033

20342034
/* inlined av_fetch() for simple cases ... */
20352035
if (!SvRMAGICAL(av) && key >= 0 && key <= AvFILLp(av)) {
2036-
sv = AvARRAY(av)[key];
2036+
sv = AvARRAY(av)[ (U8) key ];
20372037
if (sv)
20382038
goto ret;
20392039
if (!lval) {

0 commit comments

Comments
 (0)