This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
If IVSIZE == LONGSIZE, long cannot be beyond IV_MIN/IV_MAX.
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 24 Jun 2015 02:28:57 +0000 (22:28 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 27 Jun 2015 03:09:44 +0000 (23:09 -0400)
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.

ext/POSIX/POSIX.xs

index 3a3533b..96892d9 100644 (file)
@@ -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