https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107885

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:7b79fa930917da735f02b4f6911dfbb0a91f9714

commit r13-4369-g7b79fa930917da735f02b4f6911dfbb0a91f9714
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Mon Nov 28 10:52:23 2022 +0000

    libstdc++: Fix _Hash_bytes for I16LP32 targets [PR107885]

    For H8/300 size_t is 32 bits wide, but (unsigned char)buf[2] << 16
    promotes to int which is only 16 bits wide. The shift is then undefined.
    This fixes it by converting to size_t before shifting.

    libstdc++-v3/ChangeLog:

            PR libstdc++/107885
            * libsupc++/hash_bytes.cc (_Hash_bytes): Convert to size_t
            instead of implicit integer promotion to 16 bits.

Reply via email to