regexec.c: silence compiler warning
authorDavid Mitchell <davem@iabyn.com>
Tue, 11 Dec 2012 13:44:36 +0000 (13:44 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 11 Dec 2012 13:45:26 +0000 (13:45 +0000)
The code was mixing signed and unsigned types

regexec.c

index a07472d..c5ae04d 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -4823,7 +4823,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
                /* execute the code in the {...} */
 
                dSP;
-               PADOFFSET before;
+               IV before;
                OP * const oop = PL_op;
                COP * const ocurcop = PL_curcop;
                OP *nop;
@@ -4948,11 +4948,11 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
                /* we don't use MULTICALL here as we want to call the
                 * first op of the block of interest, rather than the
                 * first op of the sub */
-               before = SP-PL_stack_base;
+               before = (IV)(SP-PL_stack_base);
                PL_op = nop;
                CALLRUNOPS(aTHX);                       /* Scalar context. */
                SPAGAIN;
-               if (SP-PL_stack_base == before)
+               if ((IV)(SP-PL_stack_base) == before)
                    ret = &PL_sv_undef;   /* protect against empty (?{}) blocks. */
                else {
                    ret = POPs;