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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:4acab372d31a9fe9184ccc247780940821cda367

commit r15-5877-g4acab372d31a9fe9184ccc247780940821cda367
Author: Heiko Eißfeldt <he...@hexco.de>
Date:   Tue Dec 3 09:47:59 2024 +0100

    replace atoi with strtoul in varasm.cc (decode_reg_name_and_count)
[PR114540]

    The function uses atoi, which can silently return valid numbers even for
    some too large numbers in the string.

    Furthermore, the verification that all the characters in asmspec are
    decimal digits can be simplified when using strotoul, we can check just
    the first digit and whether the end pointer points to '\0'.

    2024-12-03  Heiko Eißfeldt  <he...@hexco.de>

            PR middle-end/114540
            * varasm.cc (decode_reg_name_and_count): Use strtoul instead of
atoi
            and simplify verification that the whole asmspec contains just
decimal
            digits.

            * gcc.dg/pr114540.c: New test.

    Signed-off-by: Heiko Eißfeldt <he...@hexco.de>
    Co-authored-by: Jakub Jelinek <ja...@redhat.com>

Reply via email to