STRLEN n_a;
tmps = POPpx;
- XPUSHu(scan_hex(tmps, sizeof(UV) * 2 + 1, &argtype));
+ XPUSHn(scan_hex(tmps, 99, &argtype));
RETURN;
}
PP(pp_oct)
{
djSP; dTARGET;
- UV value;
+ NV value;
I32 argtype;
char *tmps;
STRLEN n_a;
tmps = POPpx;
while (*tmps && isSPACE(*tmps))
tmps++;
- /* Do not eat the leading 0[bx] because we need them
- * to detect malformed binary and hexadecimal numbers. */
- if ((tmps[0] == '0' && tmps[1] == 'x') || tmps[0] == 'x')
- value = scan_hex(tmps, sizeof(UV) * 2 + 1, &argtype);
- else if ((tmps[0] == '0' && tmps[1] == 'b') || tmps[0] == 'b')
- value = scan_bin(tmps, sizeof(UV) * 8 + 1, &argtype);
+ if (*tmps == '0')
+ tmps++;
+ if (*tmps == 'x')
+ value = scan_hex(++tmps, 99, &argtype);
+ else if (*tmps == 'b')
+ value = scan_bin(++tmps, 99, &argtype);
else
- value = scan_oct(tmps, sizeof(UV) * 4 + 1, &argtype);
- XPUSHu(value);
+ value = scan_oct(tmps, 99, &argtype);
+ XPUSHn(value);
RETURN;
}
}
else if (isDIGIT(*pat)) {
len = *pat++ - '0';
- while (isDIGIT(*pat))
+ while (isDIGIT(*pat)) {
len = (len * 10) + (*pat++ - '0');
+ if (len < 0)
+ Perl_croak(aTHX_ "Repeat count in unpack overflows");
+ }
}
else
len = (datumtype != '@');
}
else if (isDIGIT(*pat)) {
len = *pat++ - '0';
- while (isDIGIT(*pat))
+ while (isDIGIT(*pat)) {
len = (len * 10) + (*pat++ - '0');
+ if (len < 0)
+ Perl_croak(aTHX_ "Repeat count in pack overflows");
+ }
}
else
len = 1;
++s;
}
}
- else if (strEQ("^", rx->precomp)) {
+ else if (rx->prelen == 1 && *rx->precomp == '^') {
+ if (!(pm->op_pmflags & PMf_MULTILINE)
+ && !(pm->op_pmregexp->reganch & ROPT_WARNED)) {
+ if (ckWARN(WARN_DEPRECATED))
+ Perl_warner(aTHX_ WARN_DEPRECATED,
+ "split /^/ better written as split /^/m");
+ pm->op_pmregexp->reganch |= ROPT_WARNED;
+ }
while (--limit) {
/*SUPPRESS 530*/
for (m = s; m < strend && *m != '\n'; m++) ;