This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Define left/right shift by negative to mean the reverse shift
Coverity CIDs 104765 and 104766
While at it, also define shifting by more than wordsize in bits to be
zero, except that undef 'use integer' (use IVs) right overshift for
negative shiftees means -1. (This is another corner where C leaves
things undefined. A common behavior is "shift by modulo worbits",
so that e.g. 1 >> 64 == 1 >> (64 % 64) == 1 >> 0, but this is completely
accidental.) (Coverity didn't flag this, harder to detect statically.)
Discussion thread at
http://www.nntp.perl.org/group/perl.perl5.porters/2015/06/msg228842.html