mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-11-18 14:00:58 +03:00
The combination of the multi-byte loop with the single byte loop confuses GCC 14.3's array bounds checker. When the loop size is constant, check to see if it is a multiple of the multi-byte size and bail early. As this will be evaluated at compile time, there should be no run-time cost. This change uses the __builtin_constant_p compile-time operation. To check if that is supported, the change uses the existing MBEDTLS_HAS_BUILTIN macro. That macro was defined later in library/common.h than is needed for this change, so it was moved up to join some other macros that looked similar. Signed-off-by: Keith Packard <keithp@keithp.com>
17 KiB
17 KiB