break;
}
itembytes = s - item;
+ chophere = s;
break;
}
RETURN;
}
+static bool
+S_outside_integer(pTHX_ SV *sv)
+{
+ if (SvOK(sv)) {
+ const NV nv = SvNV_nomg(sv);
+ if (Perl_isinfnan(nv))
+ return TRUE;
+#ifdef NV_PRESERVES_UV
+ if (nv < (NV)IV_MIN || nv > (NV)IV_MAX)
+ return TRUE;
+#else
+ if (nv <= (NV)IV_MIN)
+ return TRUE;
+ if ((nv > 0) &&
+ ((nv > (NV)UV_MAX ||
+ SvUV_nomg(sv) > (UV)IV_MAX)))
+ return TRUE;
+#endif
+ }
+ return FALSE;
+}
+
PP(pp_enteriter)
{
dSP; dMARK;
SvGETMAGIC(sv);
SvGETMAGIC(right);
if (RANGE_IS_NUMERIC(sv,right)) {
- NV nv;
cx->cx_type &= ~CXTYPEMASK;
cx->cx_type |= CXt_LOOP_LAZYIV;
/* Make sure that no-one re-orders cop.h and breaks our
assumptions */
assert(CxTYPE(cx) == CXt_LOOP_LAZYIV);
-#ifdef NV_PRESERVES_UV
- if ((SvOK(sv) && (((nv = SvNV_nomg(sv)) < (NV)IV_MIN) ||
- (nv > (NV)IV_MAX)))
- ||
- (SvOK(right) && (((nv = SvNV_nomg(right)) > (NV)IV_MAX) ||
- (nv < (NV)IV_MIN))))
-#else
- if ((SvOK(sv) && (((nv = SvNV_nomg(sv)) <= (NV)IV_MIN)
- ||
- ((nv > 0) &&
- ((nv > (NV)UV_MAX) ||
- (SvUV_nomg(sv) > (UV)IV_MAX)))))
- ||
- (SvOK(right) && (((nv = SvNV_nomg(right)) <= (NV)IV_MIN)
- ||
- ((nv > 0) &&
- ((nv > (NV)UV_MAX) ||
- (SvUV_nomg(right) > (UV)IV_MAX))
- ))))
-#endif
+ if (S_outside_integer(aTHX_ sv) ||
+ S_outside_integer(aTHX_ right))
DIE(aTHX_ "Range iterator outside integer range");
cx->blk_loop.state_u.lazyiv.cur = SvIV_nomg(sv);
cx->blk_loop.state_u.lazyiv.end = SvIV_nomg(right);
}
}
- else {
- assert(do_dump);
+ if (do_dump) {
#ifdef VMS
if (!retop) retop = PL_main_start;
#endif
#endif /* !PERL_DISABLE_PMC */
/* require doesn't search for absolute names, or when the name is
- explicity relative the current directory */
+ explicitly relative the current directory */
PERL_STATIC_INLINE bool
S_path_is_searchable(const char *name)
{
umaxlen = maxlen;
/* I was having segfault trouble under Linux 2.2.5 after a
- parse error occured. (Had to hack around it with a test
+ parse error occurred. (Had to hack around it with a test
for PL_parser->error_count == 0.) Solaris doesn't segfault --
not sure where the trouble is yet. XXX */