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

138661 Commits

Author SHA1 Message Date
Tim Düsterhus
3401d55726 zend_weakrefs: Add zend_weakrefs_hash_(clean|destroy)() (#16439)
These are equivalent to `zend_hash_clean()` and `zend_hash_destroy()`
respectively, but take care of correctly unregistering the weak references to
the keys.

This addition rounds off the weakmap functionality added in
471102edcd by taking one possible footgun away
from the user.
2024-10-14 18:57:08 +02:00
Ilija Tovilo
6292e5c878 Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Fix new closure dump syntax in test
2024-10-14 15:04:10 +02:00
Ilija Tovilo
253f4af90e [skip ci] Fix new closure dump syntax in test 2024-10-14 15:03:53 +02:00
Ilija Tovilo
fc210b44a6 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix deprecation warnings in tests
2024-10-14 14:28:12 +02:00
Ilija Tovilo
b1bd4e6a5c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix deprecation warnings in tests
2024-10-14 14:28:04 +02:00
Ilija Tovilo
817d21ecc4 Fix deprecation warnings in tests 2024-10-14 14:27:56 +02:00
Ilija Tovilo
b55b957adf Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix segfault on debug_backtrace() in _ZendTestFiber
2024-10-14 14:05:26 +02:00
Ilija Tovilo
e7dc0d2c40 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix segfault on debug_backtrace() in _ZendTestFiber
2024-10-14 14:05:21 +02:00
Ilija Tovilo
94bd6ca080 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix segfault on debug_backtrace() in _ZendTestFiber
2024-10-14 14:05:13 +02:00
Ilija Tovilo
5955ce8987 Fix segfault on debug_backtrace() in _ZendTestFiber
Fixes GH-16230
Closes GH-16299
2024-10-14 14:04:49 +02:00
Ilija Tovilo
8e3a7731cd Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix segfault in zend_test_execute_internal()
2024-10-14 14:03:34 +02:00
Ilija Tovilo
7d99355dad Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix segfault in zend_test_execute_internal()
2024-10-14 14:03:09 +02:00
Ilija Tovilo
0237361679 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix segfault in zend_test_execute_internal()
2024-10-14 14:03:01 +02:00
Ilija Tovilo
5c798415cd Fix segfault in zend_test_execute_internal()
zend_pass_function also has no name, so we might also be referring to an
internal function here. In this case, ZEND_NEW uses the zend_pass_function when
there is no constructor.

Fixes GH-16294
Closes GH-16301
2024-10-14 14:02:36 +02:00
Ilija Tovilo
41958082bd Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix exception in assert() callback with bail enabled
2024-10-14 14:01:26 +02:00
Ilija Tovilo
5f2f1a5702 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix exception in assert() callback with bail enabled
2024-10-14 14:01:16 +02:00
Ilija Tovilo
f512ff4afa Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix exception in assert() callback with bail enabled
2024-10-14 14:00:20 +02:00
Ilija Tovilo
b5c09b1a61 Fix exception in assert() callback with bail enabled
Fixes GH-16293
Closes GH-16304
2024-10-14 13:59:26 +02:00
Christoph M. Becker
d531fbd8b0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16427: Unchecked libavif return values
2024-10-14 13:55:22 +02:00
Christoph M. Becker
055b15f08c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16427: Unchecked libavif return values
2024-10-14 13:54:52 +02:00
Christoph M. Becker
05176adc4e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16427: Unchecked libavif return values
2024-10-14 13:53:42 +02:00
Christoph M. Becker
b817a4f718 Fix GH-16427: Unchecked libavif return values
Prior to libavif 1.1.0, `avifAlloc()` was infallible (it called
`abort()` on OOM conditions); thus, several API functions which used
`avifAlloc()` did not report failure.  That changed as of libavif
1.0.0[1], so checking and handling failure conditions can now be done.
However, due to `avifAlloc()` being fallible as of libavif 1.1.0, this
error checking and handling is mandatory to avoid more serious issues.

[1] <eb02b2ec52/CHANGELOG.md (L273-L281)>

Closes GH-16434.
2024-10-14 13:52:45 +02:00
Ilija Tovilo
16d25da76b Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix op2 caching for static properties
  Split expression
2024-10-14 13:46:04 +02:00
Ilija Tovilo
67318e91bc Fix op2 caching for static properties
op2.num may contain other flags, like ZEND_FETCH_CLASS_EXCEPTION. These
currently circumvent caching. Once the property is cached, these flags have no
influence on the result, so it doesn't seem like this was done on purpose.

Closes GH-16380
2024-10-14 13:45:06 +02:00
Ilija Tovilo
60562175ed Split expression 2024-10-14 13:43:48 +02:00
David Carlier
323c9f4981 [skip ci] UPGRADING/NEWS changes 2024-10-14 12:42:01 +01:00
David Carlier
6d1881b42d ext/zlib: gzfile/gzopen/readgzfile converting use_include_path argument to actual boolean.
close GH 16424
2024-10-14 12:40:57 +01:00
Ilija Tovilo
0f172715b0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Skip shebang in cli-server router script
2024-10-14 13:35:48 +02:00
Ilija Tovilo
3074cbf5b6 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Skip shebang in cli-server router script
2024-10-14 13:35:41 +02:00
Ilija Tovilo
77f770871b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Skip shebang in cli-server router script
2024-10-14 13:34:21 +02:00
Ilija Tovilo
06efe44c2e Skip shebang in cli-server router script
Fixes GH-16373
Closes GH-16403
2024-10-14 13:33:16 +02:00
Ilija Tovilo
39533af024 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix array to string conversion warning emitted in optimizer
2024-10-14 13:25:39 +02:00
Ilija Tovilo
3546733065 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix array to string conversion warning emitted in optimizer
2024-10-14 13:25:31 +02:00
Ilija Tovilo
c5745f40a5 Fix array to string conversion warning emitted in optimizer
Fixes GH-16408
Closes GH-16380
2024-10-14 13:24:05 +02:00
DanielEScherzer
275f63e7fd Zend/tests: organize some tests with subdirectories (2) (#16423)
Move more low-hanging fruit, creating new directories for the tests for:

* comparisons
* dynamic calls
* error messages
* `error_reporting()`
* exceptions
* `foreach()`
* garbage collection
* group `use` statements
* heredoc and nowdoc
* `goto` jumps
* late static binding
* magic methods
* namespaces
* numeric literal separators
* objects
* `settype()`
* cleaning of temporary values
* `unset()`

Additionally, move some tests into the existing subdirectory for `list()`
tests.

Drive-by fixes of some test numbers in the names of the `goto` tests.

Work towards GH-15631
2024-10-14 12:14:42 +01:00
Christoph M. Becker
fe76b396f5 Move ARG_(WITH|ENABLE) to the toplevel (GH-16391)
`buildconf` (and `phpize`) have special treatment for these "macros".
When configure.js is built, all config.w32 are grepped, these "macros"
are appended to configure.js, and all config.w32 contents are appended
with the "macros" commented out.  That means that for `configure` they
are in the toplevel anyway, so having them inside of `if` statements in
config.w32 is confusing.

Note that this matches autoconf behavior.
2024-10-14 10:42:19 +02:00
Niels Dossche
41c55d18f5 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
2024-10-13 21:13:12 +02:00
Niels Dossche
63c9d12a1e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
2024-10-13 21:13:06 +02:00
Niels Dossche
34e635f366 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
2024-10-13 21:12:46 +02:00
Niels Dossche
3843f0ecfe Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
Closes GH-16416.
2024-10-13 21:12:17 +02:00
Gina Peter Banyard
810a121201 Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Some more organisational fixes to UPGRADING
2024-10-13 18:49:58 +01:00
Gina Peter Banyard
da4eab6c5c [skip ci] Some more organisational fixes to UPGRADING
Closes GH-16415
2024-10-13 18:49:10 +01:00
David Carlier
79c71c9f0b Merge branch 'PHP-8.4' 2024-10-13 14:27:24 +01:00
David Carlier
61d34b3ebc Merge branch 'PHP-8.3' into PHP-8.4 2024-10-13 14:26:59 +01:00
David Carlier
47c81462b8 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-13 14:26:47 +01:00
David Carlier
d70b7811b0 ext/gmp: gmp_pow fix FPE with large values.
even without sanitizers, it is reproducible but with the following

```
<?php
$g = gmp_init(256);
var_dump(gmp_pow($g, PHP_INT_MAX));
```

we get this

```
AddressSanitizer:DEADLYSIGNAL
=================================================================
==286922==ERROR: AddressSanitizer: FPE on unknown address 0x03e8000460ca (pc 0x7faf6c69de5c bp 0x400000000000004 sp 0x7ffe9843c740 T0)
    #0 0x7faf6c69de5c in __pthread_kill_implementation nptl/pthread_kill.c:44
    #1 0x7faf6c649c81 in __GI_raise ../sysdeps/posix/raise.c:26
    #2 0x7faf6db9386c in __gmp_exception (/lib/x86_64-linux-gnu/libgmp.so.10+0xd86c) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #3 0x7faf6db938d3 in __gmp_overflow_in_mpz (/lib/x86_64-linux-gnu/libgmp.so.10+0xd8d3) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #4 0x7faf6dbac95c in __gmpz_realloc (/lib/x86_64-linux-gnu/libgmp.so.10+0x2695c) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #5 0x7faf6dba9038 in __gmpz_n_pow_ui (/lib/x86_64-linux-gnu/libgmp.so.10+0x23038) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #6 0x5565ae1ccd9f in zif_gmp_pow /home/dcarlier/Contribs/php-src/ext/gmp/gmp.c:1286
    #7 0x5565aee96ea9 in ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:1312
    #8 0x5565af144320 in execute_ex /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:56075
    #9 0x5565af160f07 in zend_execute /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:60439
    #10 0x5565aed6fafe in zend_execute_scripts /home/dcarlier/Contribs/php-src/Zend/zend.c:1842
    #11 0x5565aeae70a8 in php_execute_script /home/dcarlier/Contribs/php-src/main/main.c:2578
    #12 0x5565af532f4e in do_cli /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:964
    #13 0x5565af535877 in main /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:1334
    #14 0x7faf6c633d67 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #15 0x7faf6c633e24 in __libc_start_main_impl ../csu/libc-start.c:360
    #16 0x5565adc04040 in _start (/home/dcarlier/Contribs/php-src/sapi/cli/php+0x2604040) (BuildId: 949049955bdf8b7197390b1978a1dfc3ef6fdf38)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE nptl/pthread_kill.c:44 in __pthread_kill_implementation
==286922==ABORTING
```
2024-10-13 14:26:29 +01:00
DanielEScherzer
8475d5fea1 Zend/tests: organize some tests with subdirectories (#15638)
Move some low-hanging fruit, creating new directories for the tests for

* access modifiers
* `class_alias()`
* constant expressions
* constructor property promotion
* `__debugInfo()`
* dereferencing
* first class callable syntax

Additionally, move some tests into the existing subdirectory for
closure-related tests

Work towards GH-15631
2024-10-13 14:21:07 +01:00
David Carlier
ecccb36a41 Merge branch 'PHP-8.4' 2024-10-13 14:20:04 +01:00
David Carlier
4d008e300b Merge branch 'PHP-8.3' into PHP-8.4 2024-10-13 14:19:45 +01:00
David Carlier
f31232e218 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-13 14:19:33 +01:00