This is necessary at least on Windows to be able to actually call the
function from a different module (in this case php8phpdbg.dll could not
be build).
Closes GH-16204.
libpcre2 can return the special value -1 for a non-match.
In this case we get pointer overflow, although it doesn't matter in
practice because the pointer will be in bounds and the copy length will
be 0. Still, we should fix the UBSAN warning.
Closes GH-16205.
The reference counts of the internal document pointer are mismanaged.
In the case of fragments the refcount may be increased too much, while
for other cases the document reference may not be applied to all
children.
This bug existed for a long time and this doesn't reproduce (easily)
on 8.2 due to other bugs. Furthermore 8.2 will enter security mode soon,
and this change may be too risky.
Fixes GH-16150.
Fixed GH-16152.
Closes GH-16178.
* PHP-8.4:
[ci skip] NEWS for GH-15960
Deny resetting an object as lazy during property iteration
Ensure to initialize lazy object in foreach
Do not null out obj->properties when resetting object
Fix handling of undef property during foreach by ref on hooked class
Supporting object reset while its properties are being iterated would increase
complexity for little benefit. Furthermore it may not be possible to ensure a
consistent behavior between ghosts and proxies (wrt to iteration position).
Iteration is detected by checking if the object's properties ht has iterators.
This requires refactoring the hooked get_iterator() implementation to ensure
that it creates a properties ht iterator immediately.
Closes GH-15960
The dl_test extension is not supposed to be loaded via php.ini
settings, so we exclude it from the typical case on Windows where
`--enable-test-ini` is enabled by `--enable-snapshot-build`.
Prior to running the tests, the test runner checks for all generally
available extensions; it does this by scanning the `extension_dir` for
files matching the typical extension pattern, but verifies that the
file is actually a PHP extension by calling `dl()`. However, `dl()`
has known issues[1]. On Windows CI we always get an ugly "zend_mm_heap
corrupted" message, and we even can't `dl()` ext/mysql when OPcache is
enabled[2]. So we better avoid the double-check with `dl()`, which is
unlikely to be necessary anyway.
[1] <https://github.com/php/php-src/issues/9196>
[2] <https://github.com/php/php-src/issues/8508>
The only issue that was left was due to the old build of net-snmp 5.7.3; since updating to net-snmp 5.9.4, this is resolved.
The patch has originally been provided by @mvorisek.
Adding a stack check here as I consider serialization to be a more
sensitive place where erroring out with an exception seems appropriate.
Closes GH-16159.
* Implement JIT for ZEND_FETCH_STATIC_PROP_* and improve interpretation
* Revert incorrect change
* Use FASTCALL calling convention
* Use EMPTY_SWITCH_DEFAULT_CASE
* Move the loading of the property info into zend_jit_uninit_static_prop()
Now it's possible that PHP tracing JIT loses some parts of the "hot"
code. In case we have a root LOOP trace with an inlined call of some
function, and we get a SIDE exit inside that function - we recorded a
side trace, but finished it a the RETURN of the inlined function. As
result the opcodes betwee RETURN from SIDE trace and LOOP exit were not
covered by tracer and were executed in interpreter.
This patch introduces a "ret_depth" argument that prevents stopping
tracing on RETURN of such SIDE trace.