I32 retlen;
if ((*tmps & 0x80) && DO_UTF8(tmpsv))
- value = utf8_to_uv(tmps, &retlen, 0);
+ value = utf8_to_uv_chk(tmps, &retlen, 0);
else
value = (UV)(*tmps & 255);
XPUSHu(value);
I32 ulen;
U8 tmpbuf[UTF8_MAXLEN];
U8 *tend;
- UV uv = utf8_to_uv(s, &ulen, 0);
+ UV uv = utf8_to_uv_chk(s, &ulen, 0);
if (PL_op->op_private & OPpLOCALE) {
TAINT;
I32 ulen;
U8 tmpbuf[UTF8_MAXLEN];
U8 *tend;
- UV uv = utf8_to_uv(s, &ulen, 0);
+ UV uv = utf8_to_uv_chk(s, &ulen, 0);
if (PL_op->op_private & OPpLOCALE) {
TAINT;
TAINT;
SvTAINTED_on(TARG);
while (s < send) {
- d = uv_to_utf8(d, toUPPER_LC_uni( utf8_to_uv(s, &ulen, 0)));
+ d = uv_to_utf8(d, toUPPER_LC_uni( utf8_to_uv_chk(s, &ulen, 0)));
s += ulen;
}
}
TAINT;
SvTAINTED_on(TARG);
while (s < send) {
- d = uv_to_utf8(d, toLOWER_LC_uni( utf8_to_uv(s, &ulen, 0)));
+ d = uv_to_utf8(d, toLOWER_LC_uni( utf8_to_uv_chk(s, &ulen, 0)));
s += ulen;
}
}
len = strend - s;
if (checksum) {
while (len-- > 0 && s < strend) {
- auint = utf8_to_uv((U8*)s, &along, 0);
+ auint = utf8_to_uv_chk((U8*)s, &along, 0);
s += along;
if (checksum > 32)
cdouble += (NV)auint;
EXTEND(SP, len);
EXTEND_MORTAL(len);
while (len-- > 0 && s < strend) {
- auint = utf8_to_uv((U8*)s, &along, 0);
+ auint = utf8_to_uv_chk((U8*)s, &along, 0);
s += along;
sv = NEWSV(37, 0);
sv_setuv(sv, (UV)auint);
AV *ary;
register I32 limit = POPi; /* note, negative is forever */
SV *sv = POPs;
+ bool isutf = DO_UTF8(sv);
STRLEN len;
register char *s = SvPV(sv, len);
char *strend = s + len;
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
s = m + 1;
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
s = m;
}
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
s = m + 1;
}
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
s = m + len; /* Fake \n at the end */
}
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
if (rx->nparens) {
for (i = 1; i <= rx->nparens; i++) {
dstr = NEWSV(33, 0);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
}
}
sv_setpvn(dstr, s, strend-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
iters++;
}