1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Workaraound against false positive GCC array bounds error (#15078)

This prevents compilation error when compiling PHP by GCC with "-O2 -g -Wall -Werror"

zend_API.c:2754:34: error: array subscript ‘zend_function
{aka const union _zend_function}[0]’ is partly outside array bounds of
‘unsigned char[160]’ [-Werror=array-bounds=]

 2754 |         if (ZSTR_VAL(fptr->common.function_name)[0] != '_'
This commit is contained in:
Dmitry Stogov
2024-07-24 08:21:16 +03:00
committed by GitHub
parent 0956267c08
commit d41e97ae66

View File

@@ -2559,8 +2559,8 @@ static void zend_check_magic_method_no_return_type(
ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, zend_string *lcname, int error_type) /* {{{ */
{
if (ZSTR_VAL(fptr->common.function_name)[0] != '_'
|| ZSTR_VAL(fptr->common.function_name)[1] != '_') {
if (ZSTR_VAL(lcname)[0] != '_'
|| ZSTR_VAL(lcname)[1] != '_') {
return;
}