This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid integer overflow in pp_flop()
authorDavid Mitchell <davem@iabyn.com>
Mon, 22 Dec 2014 20:04:59 +0000 (20:04 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 31 Dec 2014 11:28:52 +0000 (11:28 +0000)
commitfc01cab408a7f4e5d9726611998d5b9c01f727ae
tree5e70f14e023312e3332b28cb8f6eb9a74a4e42e5
parent02b08bbcbd0ac87188306a567fc071bbfd134777
avoid integer overflow in pp_flop()

This;
    @a=(0x7ffffffffffffffe..0x7fffffffffffffff);

could produce under ASan:

    pp_ctl.c:1212:19: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'IV' (aka 'long')

so avoid post-incrementing the loop var on the last iteration.

This fix is more to shut ASan up than an actual bug, since the
bad value on the last iteration wouldn't actually be used.
pp_ctl.c