Skip to content

Commit b5e2ae2

Browse files
committed
Merge branch 'master' into jit-dynasm
* master: (36 commits) Don't generate script for proc_open_pipes tests Use separate output files in x2gd tests Use separate directories for win32 dir tests Fix test error message Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE Fix bug #77540 - Invalid Read on exif_process_SOFn Fix integer overflows on 32-bits Fix #77431 SplFileInfo::__construct() accepts NUL bytes Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow Update NEWS Fix test error message Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE Fix bug #77540 - Invalid Read on exif_process_SOFn Fix integer overflows on 32-bits Fix #77431 SplFileInfo::__construct() accepts NUL bytes Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename [ci skip] Remove oniguruma and libzip leftovers Remove outdated hack for AIX 4 Remove AC_PROG_CC_C_O ...
2 parents eaf0973 + 6be0511 commit b5e2ae2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+291
-300
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ config.h.in
110110
/ext/iconv/php_iconv_supports_errno.h
111111
/ext/iconv/php_php_iconv_h_path.h
112112
/ext/iconv/php_php_iconv_impl.h
113-
/ext/mbstring/oniguruma/oniguruma.h
114113
/main/build-defs.h
115114
/main/php_config.h.in
116115
/main/php_config.h
@@ -300,6 +299,5 @@ tmp-php.ini
300299
!/ext/fileinfo/libmagic/config.h
301300
!/ext/fileinfo/libmagic.patch
302301
!/ext/fileinfo/magicdata.patch
303-
!/ext/mbstring/oniguruma.patch
304302
!/ext/pcre/pcre2lib/config.h
305303
!/win32/build/Makefile

Makefile.gcov

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ php_lcov.info: lcov-test
5656
cp $$x.bbg lcov_data/$$y.bbg ; \
5757
fi; \
5858
done; \
59-
for dir in ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/oniguruma ext/pcre/pcre2lib ext/zip/lib; do \
59+
for dir in ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/pcre/pcre2lib; do \
6060
if test -d lcov_data/$$dir; then \
6161
rm -rf lcov_data/$$dir ; \
6262
fi; \

Makefile.global

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,21 @@ PHP_TEST_SHARED_EXTENSIONS = ` \
8383
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname"; \
8484
done; \
8585
fi`
86-
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
86+
PHP_FILTERED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|zend_extension(_debug)?(_ts)?)[\t\ ]*='
87+
PHP_EXTENSION_PATH_FIX_REGEX = "/^extension *= *[^/]/s,extension *= *,extension=$(EXTENSION_DIR)/,g"
8788

8889
test: all
8990
@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
9091
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
9192
if test "$$INI_FILE"; then \
92-
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
93+
$(EGREP) -h -v $(PHP_FILTERED_DIRECTIVES_REGEX) "$$INI_FILE" | $(SED) $(PHP_EXTENSION_PATH_FIX_REGEX) > $(top_builddir)/tmp-php.ini; \
9394
else \
9495
echo > $(top_builddir)/tmp-php.ini; \
9596
fi; \
9697
INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
9798
if test "$$INI_SCANNED_PATH"; then \
9899
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
99-
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
100+
$(EGREP) -h -v $(PHP_FILTERED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini | $(SED) $(PHP_EXTENSION_PATH_FIX_REGEX) >> $(top_builddir)/tmp-php.ini; \
100101
fi; \
101102
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
102103
TEST_PHP_SRCDIR=$(top_srcdir) \
@@ -120,7 +121,7 @@ clean:
120121
distclean: clean
121122
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
122123
rm -f php.spec main/build-defs.h scripts/phpize
123-
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
124+
rm -f ext/date/lib/timelib_config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
124125
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1
125126
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
126127
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h

README.REDIST.BINS

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
1. libmagic (ext/fileinfo) see ext/fileinfo/libmagic/LICENSE
2-
2. Oniguruma (ext/mbstring) see ext/mbstring/oniguruma/COPYING
3-
3. libmbfl (ext/mbstring) see ext/mbstring/libmbfl/LICENSE
4-
4. pcre2lib (ext/pcre)
5-
5. ext/standard crypt
6-
6. ext/standard crypt's blowfish implementation
7-
7. ext/standard/rand
8-
8. ext/standard/scanf
9-
9. ext/standard/strnatcmp.c
10-
10. ext/standard/uuencode
11-
11. libxmlrpc ext/xmlrpc
12-
12. main/snprintf.c
13-
13. main/strlcat
14-
14. main/strlcpy
15-
15. libgd see ext/gd/libgd/COPYING
16-
16. ext/phar portions of tar implementations
17-
17. ext/phar/zip.c portion extracted from libzip
18-
18. libbcmath (ext/bcmath) see ext/bcmath/libbcmath/COPYING.LIB
19-
20-
21-
4. pcre2lib (ext/pcre)
2+
2. libmbfl (ext/mbstring) see ext/mbstring/libmbfl/LICENSE
3+
3. pcre2lib (ext/pcre)
4+
4. ext/standard crypt
5+
5. ext/standard crypt's blowfish implementation
6+
6. ext/standard/rand
7+
7. ext/standard/scanf
8+
8. ext/standard/strnatcmp.c
9+
9. ext/standard/uuencode
10+
10. libxmlrpc ext/xmlrpc
11+
11. main/snprintf.c
12+
12. main/strlcat
13+
13. main/strlcpy
14+
14. libgd see ext/gd/libgd/COPYING
15+
15. ext/phar portions of tar implementations
16+
16. ext/phar/zip.c portion extracted from libzip
17+
17. libbcmath (ext/bcmath) see ext/bcmath/libbcmath/COPYING.LIB
18+
19+
20+
3. pcre2lib (ext/pcre)
2221

2322
PCRE2 LICENCE
2423
-------------
@@ -116,7 +115,7 @@ PCRE2 independently.
116115
End
117116

118117

119-
5. ext/standard crypt
118+
4. ext/standard crypt
120119

121120
FreeSec: libcrypt for NetBSD
122121

@@ -148,7 +147,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
148147
SUCH DAMAGE.
149148

150149

151-
6. ext/standard crypt's blowfish implementation
150+
5. ext/standard crypt's blowfish implementation
152151

153152
The crypt_blowfish homepage is:
154153

@@ -194,7 +193,7 @@ Blowfish library (I can't be sure if I would think of something if I
194193
hadn't seen his code).
195194

196195

197-
7. ext/standard/rand
196+
6. ext/standard/rand
198197

199198
The following php_mt_...() functions are based on a C++ class MTRand by
200199
Richard J. Wagner. For more information see the web page at
@@ -248,7 +247,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
248247
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
249248

250249

251-
8. ext/standard/scanf
250+
7. ext/standard/scanf
252251

253252
scanf.c --
254253

@@ -296,7 +295,7 @@ permission to use and distribute the software in accordance with the
296295
terms specified in this license.
297296

298297

299-
9. ext/standard/strnatcmp.c
298+
8. ext/standard/strnatcmp.c
300299

301300
strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
302301
Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
@@ -318,7 +317,7 @@ freely, subject to the following restrictions:
318317
3. This notice may not be removed or altered from any source distribution.
319318

320319

321-
10. ext/standard/uuencode
320+
9. ext/standard/uuencode
322321

323322
Portions of this code are based on Berkeley's uuencode/uudecode
324323
implementation.
@@ -355,7 +354,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
355354
SUCH DAMAGE.
356355

357356

358-
11. libxmlrpc ext/xmlrpc
357+
10. libxmlrpc ext/xmlrpc
359358

360359
Copyright 2000 Epinions, Inc.
361360

@@ -380,7 +379,7 @@ NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH
380379
DAMAGES.
381380

382381

383-
12. main/snprintf.c
382+
11. main/snprintf.c
384383

385384
Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com>
386385

@@ -455,8 +454,8 @@ SIO stdio-replacement strx_* functions by Panos Tsirigotis
455454
<panos@alumni.cs.colorado.edu> for xinetd.
456455

457456

458-
13. main/strlcat
459-
14. main/strlcpy
457+
12. main/strlcat
458+
13. main/strlcpy
460459

461460
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
462461
All rights reserved.
@@ -484,7 +483,7 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
484483
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
485484

486485

487-
16. ext/phar portions of tar implementations
486+
15. ext/phar portions of tar implementations
488487

489488
portions of tar implementations in ext/phar - phar_tar_octal() are based on an
490489
implementation by Tim Kientzle from libarchive, licensed with this license:
@@ -513,7 +512,7 @@ implementation by Tim Kientzle from libarchive, licensed with this license:
513512
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
514513

515514

516-
17. ext/phar/zip.c portion extracted from libzip
515+
16. ext/phar/zip.c portion extracted from libzip
517516

518517
zip_dirent.c -- read directory entry (local or central), clean dirent
519518
Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner

TSRM/tsrm.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ AC_DEFUN([TSRM_BASIC_CHECKS],[
44
55
AC_REQUIRE([AC_PROG_CC])dnl
66
dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
7-
AC_REQUIRE([AC_PROG_CC_C_O])dnl
87
AC_REQUIRE([AC_PROG_RANLIB])dnl
98
109
AC_CHECK_FUNCS(sigprocmask)

Zend/Zend.m4

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,13 @@ dnl
22
dnl This file contains Zend specific autoconf functions.
33
dnl
44

5-
AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
6-
AC_MSG_CHECKING(for $1)
7-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8-
#if HAVE_SYS_TYPES_H
9-
#include <sys/types.h>
10-
#endif
11-
#if HAVE_INTTYPES_H
12-
#include <inttypes.h>
13-
#elif HAVE_STDINT_H
14-
#include <stdint.h>
15-
#endif]],
16-
[[if (($1 *) 0)
17-
return 0;
18-
if (sizeof ($1))
19-
return 0;
20-
]])],[
21-
AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z_-,A-Z__), 1,[Define if $1 type is present. ])
22-
AC_MSG_RESULT(yes)
23-
], [AC_MSG_RESULT(no)
24-
])dnl
25-
])
26-
275
AC_DEFUN([LIBZEND_BASIC_CHECKS],[
286
297
AC_REQUIRE([AC_PROG_YACC])
308
AC_REQUIRE([AC_PROG_CC])
31-
AC_REQUIRE([AC_PROG_CC_C_O])
32-
AC_REQUIRE([AC_HEADER_STDC])
339
3410
LIBZEND_BISON_CHECK
3511
36-
dnl Ugly hack to get around a problem with gcc on AIX.
37-
if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
38-
"`uname -sv`" = "AIX 4"; then
39-
CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
40-
fi
41-
4212
AC_CHECK_HEADERS(
4313
inttypes.h \
4414
stdint.h \
@@ -73,13 +43,9 @@ dnl This is required for QNX and may be some BSD derived systems
7343
AC_CHECK_TYPE( uint, unsigned int )
7444
AC_CHECK_TYPE( ulong, unsigned long )
7545
76-
dnl Check if int32_t and uint32_t are defined
77-
LIBZEND_CHECK_INT_TYPE(int32_t)
78-
LIBZEND_CHECK_INT_TYPE(uint32_t)
79-
8046
dnl Checks for library functions.
8147
AC_FUNC_ALLOCA
82-
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
48+
AC_CHECK_FUNCS(strdup getpid kill strtod strtol finite fpclass sigsetjmp)
8349
8450
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
8551

Zend/zend_alloc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ static zend_never_inline void *zend_mm_alloc_small_slow(zend_mm_heap *heap, uint
12771277
return (char*)bin;
12781278
}
12791279

1280-
static zend_always_inline void *zend_mm_alloc_small(zend_mm_heap *heap, size_t size, int bin_num ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
1280+
static zend_always_inline void *zend_mm_alloc_small(zend_mm_heap *heap, int bin_num ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
12811281
{
12821282
#if ZEND_MM_STAT
12831283
do {
@@ -1361,7 +1361,7 @@ static zend_always_inline void *zend_mm_alloc_heap(zend_mm_heap *heap, size_t si
13611361
}
13621362
#endif
13631363
if (EXPECTED(size <= ZEND_MM_MAX_SMALL_SIZE)) {
1364-
ptr = zend_mm_alloc_small(heap, size, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1364+
ptr = zend_mm_alloc_small(heap, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
13651365
#if ZEND_DEBUG
13661366
dbg = zend_mm_get_debug_info(heap, ptr);
13671367
dbg->size = real_size;
@@ -1587,7 +1587,7 @@ static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *p
15871587
/* Check if truncation is necessary */
15881588
if (old_bin_num > 0 && size < bin_data_size[old_bin_num - 1]) {
15891589
/* truncation */
1590-
ret = zend_mm_alloc_small(heap, size, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1590+
ret = zend_mm_alloc_small(heap, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
15911591
copy_size = use_copy_size ? MIN(size, copy_size) : size;
15921592
memcpy(ret, ptr, copy_size);
15931593
zend_mm_free_small(heap, ptr, old_bin_num);
@@ -1602,7 +1602,7 @@ static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *p
16021602
do {
16031603
size_t orig_peak = heap->peak;
16041604
#endif
1605-
ret = zend_mm_alloc_small(heap, size, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1605+
ret = zend_mm_alloc_small(heap, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
16061606
copy_size = use_copy_size ? MIN(old_size, copy_size) : old_size;
16071607
memcpy(ret, ptr, copy_size);
16081608
zend_mm_free_small(heap, ptr, old_bin_num);
@@ -2451,7 +2451,7 @@ ZEND_API int is_zend_ptr(const void *ptr)
24512451
# define _ZEND_BIN_ALLOCATOR(_num, _size, _elements, _pages, x, y) \
24522452
ZEND_API void* ZEND_FASTCALL _emalloc_ ## _size(void) { \
24532453
ZEND_MM_CUSTOM_ALLOCATOR(_size); \
2454-
return zend_mm_alloc_small(AG(mm_heap), _size, _num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); \
2454+
return zend_mm_alloc_small(AG(mm_heap), _num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); \
24552455
}
24562456

24572457
ZEND_MM_BINS_INFO(_ZEND_BIN_ALLOCATOR, x, y)
@@ -2589,7 +2589,7 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC Z
25892589

25902590
ZEND_API void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
25912591
{
2592-
return emalloc_rel(zend_safe_address_guarded(nmemb, size, offset));
2592+
return _emalloc(zend_safe_address_guarded(nmemb, size, offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
25932593
}
25942594

25952595
ZEND_API void* ZEND_FASTCALL _safe_malloc(size_t nmemb, size_t size, size_t offset)
@@ -2599,7 +2599,7 @@ ZEND_API void* ZEND_FASTCALL _safe_malloc(size_t nmemb, size_t size, size_t offs
25992599

26002600
ZEND_API void* ZEND_FASTCALL _safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
26012601
{
2602-
return erealloc_rel(ptr, zend_safe_address_guarded(nmemb, size, offset));
2602+
return _erealloc(ptr, zend_safe_address_guarded(nmemb, size, offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
26032603
}
26042604

26052605
ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset)
@@ -2612,7 +2612,7 @@ ZEND_API void* ZEND_FASTCALL _ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_D
26122612
void *p;
26132613

26142614
size = zend_safe_address_guarded(nmemb, size, 0);
2615-
p = emalloc_rel(size);
2615+
p = _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
26162616
memset(p, 0, size);
26172617
return p;
26182618
}

Zend/zend_compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ static zend_always_inline int zend_check_arg_send_type(const zend_function *zf,
950950
#define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \
951951
zend_check_arg_send_type(zf, arg_num, ZEND_SEND_PREFER_REF)
952952

953-
/* Quick API to check firat 12 arguments */
953+
/* Quick API to check first 12 arguments */
954954
#define MAX_ARG_FLAG_NUM 12
955955

956956
#ifdef WORDS_BIGENDIAN

Zend/zend_execute.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3261,7 +3261,7 @@ ZEND_API void zend_free_compiled_variables(zend_execute_data *execute_data) /* {
32613261
* +========================================+
32623262
* EG(current_execute_data) -> | zend_execute_data |
32633263
* +----------------------------------------+
3264-
* EX_CV_NUM(0) ---------> | VAR[0] = ARG[1] |
3264+
* EX_VAR_NUM(0) --------> | VAR[0] = ARG[1] |
32653265
* | ... |
32663266
* | VAR[op_array->num_args-1] = ARG[N] |
32673267
* | ... |
@@ -3274,6 +3274,15 @@ ZEND_API void zend_free_compiled_variables(zend_execute_data *execute_data) /* {
32743274
* +----------------------------------------+
32753275
*/
32763276

3277+
/* zend_copy_extra_args is used when the actually passed number of arguments
3278+
* (EX_NUM_ARGS) is greater than what the function defined (op_array->num_args).
3279+
*
3280+
* The extra arguments will be copied into the call frame after all the compiled variables.
3281+
*
3282+
* If there are extra arguments copied, a flag "ZEND_CALL_FREE_EXTRA_ARGS" will be set
3283+
* on the zend_execute_data, and when the executor leaves the function, the
3284+
* args will be freed in zend_leave_helper.
3285+
*/
32773286
static zend_never_inline void zend_copy_extra_args(EXECUTE_DATA_D)
32783287
{
32793288
zend_op_array *op_array = &EX(func)->op_array;

Zend/zend_generators.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
123123
/* always free the CV's, in the symtable are only not-free'd IS_INDIRECT's */
124124
zend_free_compiled_variables(execute_data);
125125

126-
if ((EX_CALL_INFO() & ZEND_CALL_RELEASE_THIS) &&
127-
EXPECTED(GC_TYPE(Z_OBJ(execute_data->This)) == IS_OBJECT)) {
126+
if (EX_CALL_INFO() & ZEND_CALL_RELEASE_THIS) {
128127
OBJ_RELEASE(Z_OBJ(execute_data->This));
129128
}
130129

@@ -144,8 +143,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
144143
}
145144

146145
/* Free closure object */
147-
if ((EX_CALL_INFO() & ZEND_CALL_CLOSURE) &&
148-
EXPECTED(GC_TYPE(ZEND_CLOSURE_OBJECT(EX(func))) == IS_OBJECT)) {
146+
if (EX_CALL_INFO() & ZEND_CALL_CLOSURE) {
149147
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
150148
}
151149

0 commit comments

Comments
 (0)