This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pack(): avoid << of negative values
authorDavid Mitchell <davem@iabyn.com>
Mon, 22 Dec 2014 20:12:22 +0000 (20:12 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 31 Dec 2014 11:28:52 +0000 (11:28 +0000)
commite68aed92f594456b596d9b3d8c0fba00406fe76d
treee15d502db43ece5dafaa95e945c3bbab52060ee9
parentfc01cab408a7f4e5d9726611998d5b9c01f727ae
pack(): avoid << of negative values

Treat the string as U8* rather than char* when doing all the
bit shifts for uuencode. That stops these warnings under ASan:

    pp_pack.c:1890:34: runtime error: left shift of negative value -127
    pp_pack.c:1891:34: runtime error: left shift of negative value -126
    pp_pack.c:1899:34: runtime error: left shift of negative value -1
    pp_pack.c:1900:30: runtime error: left shift of negative value -31
pp_pack.c