Skip to content

Commit d41e97a

Browse files
authored
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] != '_'
1 parent 0956267 commit d41e97a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,8 +2559,8 @@ static void zend_check_magic_method_no_return_type(
25592559

25602560
ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, zend_string *lcname, int error_type) /* {{{ */
25612561
{
2562-
if (ZSTR_VAL(fptr->common.function_name)[0] != '_'
2563-
|| ZSTR_VAL(fptr->common.function_name)[1] != '_') {
2562+
if (ZSTR_VAL(lcname)[0] != '_'
2563+
|| ZSTR_VAL(lcname)[1] != '_') {
25642564
return;
25652565
}
25662566

0 commit comments

Comments
 (0)