summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 2bed58cce4..6cb26bd02c 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1230,8 +1230,10 @@ PP(pp_flop)
if (RANGE_IS_NUMERIC(left,right)) {
IV i, j;
IV max;
- if ((SvOK(left) && SvNV_nomg(left) < IV_MIN) ||
- (SvOK(right) && SvNV_nomg(right) > IV_MAX))
+ if ((SvOK(left) && !SvIOK(left) && SvNV_nomg(left) < IV_MIN) ||
+ (SvOK(right) && (SvIOK(right)
+ ? SvIsUV(right) && SvUV(right) > IV_MAX
+ : SvNV_nomg(right) > IV_MAX)))
DIE(aTHX_ "Range iterator outside integer range");
i = SvIV_nomg(left);
max = SvIV_nomg(right);