if (!SvCUR(sv) || *(SvEND(sv) - 1) != '\n') {
dTHR;
if (PL_curcop->cop_line)
+#ifdef IV_IS_QUAD
+ Perl_sv_catpvf(aTHX_ sv, " at %_ line %" PERL_PRId64,
+ GvSV(PL_curcop->cop_filegv), (IV)PL_curcop->cop_line);
+#else
Perl_sv_catpvf(aTHX_ sv, " at %_ line %ld",
GvSV(PL_curcop->cop_filegv), (long)PL_curcop->cop_line);
+#endif
if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) {
bool line_mode = (RsSIMPLE(PL_rs) &&
SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n');
+#ifdef IV_IS_QUAD
+ Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %" PERL_PRId64,
+ PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv),
+ line_mode ? "line" : "chunk",
+ (IV)IoLINES(GvIOp(PL_last_in_gv)));
+#else
Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %ld",
PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv),
line_mode ? "line" : "chunk",
(long)IoLINES(GvIOp(PL_last_in_gv)));
+#endif
}
#ifdef USE_THREADS
if (thr->tid)
register UV ruv = 0;
register bool seenb = FALSE;
register bool overflowed = FALSE;
- char *nonzero = NULL;
for (; len-- && *s; s++) {
if (!(*s == '0' || *s == '1')) {
if (*s == '_')
continue; /* Note: does not check for __ and the like. */
- if (seenb == FALSE && *s == 'b' && nonzero == NULL) {
+ if (seenb == FALSE && *s == 'b' && ruv == 0) {
/* Disallow 0bbb0b0bbb... */
seenb = TRUE;
continue;
"Illegal binary digit '%c' ignored", *s);
break;
}
- } else {
- if (nonzero == NULL && *s != '0')
- nonzero = s;
}
if (!overflowed) {
register UV xuv = ruv << 1;
* is a waste of time (because the NV cannot preserve
* the low-order bits anyway): we could just remember when
* did we overflow and in the end just multiply rnv by the
- * right amount of 16-tuples. */
+ * right amount. */
rnv += (*s - '0');
}
}
if (!overflowed)
rnv = (NV) ruv;
- if (sizeof(UV) > 4 && nonzero && (s - nonzero) > 32) {
+ if ( ( overflowed && rnv > 4294967295.0)
+#if UV_SIZEOF > 4
+ || (!overflowed && ruv > 0xffffffff )
+#endif
+ ) {
dTHR;
if (ckWARN(WARN_UNSAFE))
Perl_warner(aTHX_ WARN_UNSAFE,
register NV rnv = 0.0;
register UV ruv = 0;
register bool overflowed = FALSE;
- char *nonzero = NULL;
for (; len-- && *s; s++) {
if (!(*s >= '0' && *s <= '7')) {
break;
}
}
- else {
- if (nonzero == NULL && *s != '0')
- nonzero = s;
- }
if (!overflowed) {
- register xuv = ruv << 3;
+ register UV xuv = ruv << 3;
if ((xuv >> 3) != ruv) {
dTHR;
}
if (!overflowed)
rnv = (NV) ruv;
- if (sizeof(UV) > 4 &&
- overflowed ? rnv > 4294967295.0 :
- (nonzero && (s - nonzero) > 10 && (ruv >> 30) > 3)) {
+ if ( ( overflowed && rnv > 4294967295.0)
+#if UV_SIZEOF > 4
+ || (!overflowed && ruv > 0xffffffff )
+#endif
+ ) {
dTHR;
if (ckWARN(WARN_UNSAFE))
Perl_warner(aTHX_ WARN_UNSAFE,
register UV ruv = 0;
register bool seenx = FALSE;
register bool overflowed = FALSE;
- char *nonzero = NULL;
char *hexdigit;
for (; len-- && *s; s++) {
if (!hexdigit) {
if (*s == '_')
continue; /* Note: does not check for __ and the like. */
- if (seenx == FALSE && *s == 'x' && nonzero == NULL) {
+ if (seenx == FALSE && *s == 'x' && ruv == 0) {
/* Disallow 0xxx0x0xxx... */
seenx = TRUE;
continue;
break;
}
}
- else {
- if (nonzero == NULL && *s != '0')
- nonzero = s;
- }
if (!overflowed) {
register UV xuv = ruv << 4;
}
if (!overflowed)
rnv = (NV) ruv;
- if (sizeof(UV) > 4 &&
- nonzero && (s - nonzero) > 8) {
+ if ( ( overflowed && rnv > 4294967295.0)
+#if UV_SIZEOF > 4
+ || (!overflowed && ruv > 0xffffffff )
+#endif
+ ) {
dTHR;
if (ckWARN(WARN_UNSAFE))
Perl_warner(aTHX_ WARN_UNSAFE,