Skip to content

Commit

Permalink
If IVSIZE == LONGSIZE, long cannot be beyond IV_MIN/IV_MAX.
Browse files Browse the repository at this point in the history
It can be if LONGSIZE > IVSIZE, which should be rather rare
(since Perl aims for at least long, someone would have to
force IV to be 32 bits?)

Coverity CID 104770.
  • Loading branch information
jhi committed Jun 27, 2015
1 parent 07bd88d commit 188f97e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/POSIX/POSIX.xs
Expand Up @@ -3431,7 +3431,7 @@ strtol(str, base = 0)
PPCODE:
if (base == 0 || (base >= 2 && base <= 36)) {
num = strtol(str, &unparsed, base);
#if IVSIZE <= LONGSIZE
#if IVSIZE < LONGSIZE
if (num < IV_MIN || num > IV_MAX)
PUSHs(sv_2mortal(newSVnv((double)num)));
else
Expand Down

0 comments on commit 188f97e

Please sign in to comment.