{
dVAR; dSP; dTARGET;
SV *sv;
- I32 len = 0;
+ IV len = 0;
STRLEN curlen;
STRLEN utf8_curlen;
- I32 pos;
- I32 rem;
- I32 fail;
+ IV pos;
+ IV rem;
+ IV fail;
const I32 lvalue = PL_op->op_flags & OPf_MOD || LVRET;
const char *tmps;
const I32 arybase = CopARYBASE_get(PL_curcop);
rem = curlen;
else if (len >= 0) {
rem = pos+len;
- if (rem > (I32)curlen)
+ if (rem > (IV)curlen)
rem = curlen;
}
else {
RETPUSHUNDEF;
}
else {
- const I32 upos = pos;
- const I32 urem = rem;
+ const IV upos = pos;
+ const IV urem = rem;
+ /* FIXME -- if an IV is longer than an I32, we're truncating here,
+ * but a 64-bit version of sv_pos_u2b is not (yet) available.
+ */
if (utf8_curlen)
- sv_pos_u2b(sv, &pos, &rem);
+ sv_pos_u2b(sv, (I32 *)&pos, (I32 *)&rem);
tmps += pos;
/* we either return a PV or an LV. If the TARG hasn't been used
* before, or is of that type, reuse it; otherwise use a mortal