Skip to content

Commit 974201d

Browse files
dstogovDavid Ellingsworth
authored and
David Ellingsworth
committed
Workaraound against false positive GCC array bounds error (php#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 40cf2e1 commit 974201d

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
@@ -2751,8 +2751,8 @@ static void zend_check_magic_method_no_return_type(
27512751

27522752
ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, zend_string *lcname, int error_type) /* {{{ */
27532753
{
2754-
if (ZSTR_VAL(fptr->common.function_name)[0] != '_'
2755-
|| ZSTR_VAL(fptr->common.function_name)[1] != '_') {
2754+
if (ZSTR_VAL(lcname)[0] != '_'
2755+
|| ZSTR_VAL(lcname)[1] != '_') {
27562756
return;
27572757
}
27582758

0 commit comments

Comments
 (0)