| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERNALS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then later
possibly renamed. When opcache is not used and a file containing a
closure is repeatedly included, this leads to a very large memory leak,
as the no longer needed closure declarations will never be freed
(https://bugs.php.net/bug.php?id=76982).
With this patch, dynamic functions are instead stored in a
dynamic_func_defs member on the op_array, which opcodes reference
by index. When the parent op_array is destroyed, the dynamic_func_defs
it contains are also destroyed (unless they are stilled used elsewhere,
e.g. because they have been bound, or are used by a live closure). This
resolves the fundamental part of the leak, though doesn't completely
fix it yet due to some arena allocations.
The main non-obvious change here is to static variable handling:
We can't destroy static_variables_ptr in destroy_op_array, as e.g.
that would clear the static variables in a dynamic function when
the op_array containing it is destroyed. Static variable destruction
is separated out for this reason (we already do static variable
destruction separately for normal functions, so we only need to
handle main scripts).
Closes GH-5595.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
* PHP-8.0:
Fix potential file collision in dom tests
Fix bug #80757 (Exit code is 0 when could not open file)
Update NEWS
|
| |\ |
|
| | | |
|
| | |
| | |
| | |
| | | |
Related to GH-6701
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Update year to 2021
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.4:
Update year to 2021
|
| | |
| | |
| | |
| | | |
Closes GH-6636.
|
| | |
| | |
| | |
| | |
| | | |
This reverts commit 5e15c9c41f8318a8392c2e2c78544f218736549c, since
re2c default rules are only available as of re2c 0.13.7.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.
Of course, zend_bool is retained as an alias.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Revert fix for bug 76813 and re2c version bump
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
CentOS 7 ships with re2c 0.13.5 by default, so we should not have
bumped the required re2c version to 0.13.7. However, 0.13.5 does not
support default rules, so we cannot use them to fix bug 76813.
This reverts commit 420184ad529443182c9a348a55b1c9216005c613 and
5e15c9c41f8318a8392c2e2c78544f218736549c.
Closes GH-6593.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This restricts allowed usage of $GLOBALS, with the effect that
plain PHP arrays can no longer contain INDIRECT elements.
RFC: https://wiki.php.net/rfc/restrict_globals_usage
Closes GH-6487.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This would be either $end or "end of file" depending on bison
version. Explicitly specify "end of command" instead, which seems
more appropriate in context.
|
|/ /
| |
| |
| | |
Closes GH-6462.
|
| |
| |
| |
| | |
phpdbg now disables JIT, so these cause XFAIL warnings.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix #76813: Access violation near NULL on source operand
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We avoid `YYCURSOR` becoming `NULL` by initializing `YYMARKER`, and add
a default rule for `<NORMAL>` where we catch unexpected input.
We also fix the only superficially related issue regarding empty input
followed by `T_SEPARATOR` and command, which caused another segfault.
Closes GH-6464.
|
| |
| |
| |
| | |
Closes GH-6173
|
| |
| |
| |
| |
| |
| | |
This is an annoying edge case that regularly gets broken. As we're
not aware of significant users of this API, and there are other
ways to hook this, remove support for EXT_NOP.
|
| |
| |
| |
| | |
Closes GH-6049.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Otherwise the assignment will have the same number as the default arm
which will 1. mis-trigger a breakpoint and 2. mark the line as covered
even when it isn't.
Closes GH-6083
|
| | |
|
| |
| |
| |
| |
| |
| | |
We might just want to drop this completely, but at least don't
enable it by default. It already gets disabled by a number of
SAPIs, but we should make that the default state.
|
| |
| |
| |
| |
| |
| |
| | |
The primary issue was already resolved in 7c3e487289ec41e560cf7a77e36eb43da2234f33,
but the particular example used in this bug report ran into an
additional issue on PHP 8, because I forgot to drop a number of
zend_bailout calls when switch require failure to throw.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Closes GH-5943
|
| | |
|
| | |
|
| |
| |
| |
| | |
Closes GH-5758
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
exit() is now internally implemented by throwing an exception,
performing a normal stack unwind and a clean shutdown. This ensures
that no persistent resource leaks occur.
The exception is internal, cannot be caught and does not result in
the execution of finally blocks. This may be relaxed in the future.
Closes GH-5768.
|
| |
| |
| |
| | |
The test fails as of commit 8b12ea04ee405f746ca2394672f8372c57fd05b2.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.
This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.
Closes GH-5739.
|
| |
| |
| |
| |
| | |
This whole code is very dubious and should possibly be dropped. For
now just fix the build warning.
|
| |
| |
| |
| |
| |
| | |
getrusage supports only two fields. The network api sits in the network lib.
Closes GH-5732.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds. This may be useful for other compilers as well.
[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the following APIs:
void zend_call_known_function(
zend_function *fn, zend_object *object, zend_class_entry *called_scope,
zval *retval_ptr, int param_count, zval *params);
void zend_call_known_instance_method(
zend_function *fn, zend_object *object, zval *retval_ptr, int param_count, zval *params);
void zend_call_known_instance_method_with_0_params(
zend_function *fn, zend_object *object, zval *retval_ptr);
void zend_call_known_instance_method_with_1_params(
zend_function *fn, zend_object *object, zval *retval_ptr, zval *param);
void zend_call_known_instance_method_with_2_params(
zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2);
These are used to perform a call if you already have the
zend_function you want to call. zend_call_known_function()
is the base API, the rest are just really thin wrappers around
it for the common case of instance method calls.
Closes GH-5692.
|
| |
| |
| |
| | |
Closes GH-5676.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We fix (hopefully) all instances of:
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312>
`zend_llist_add_element()` and `zend_llist_prepend_element()` now
explicitly expect a *const* pointer.
We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress
C4090; this should prevent accidential removal of the cast by
clarifying the intention, and makes it easier to remove the casts if
the issue[1] will be resolved sometime.
[1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The implementation of that RFC changed the initial value of
`zend_array.nNextFreeElement` to `-1`; we work around that by inserting
first, and retrieving the index afterwards.
We also fix the erroneous printf specifier for the unsigned integer.
|
| |
| |
| |
| | |
Merge mistake...
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Skip new watch point test under asan
|
| | |
|