History log of /PHP-8.2/Zend/zend_execute_API.c (Results 26 – 50 of 1005)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# adc23828 02-Dec-2022 Arnaud Le Blanc

Fallback to first line of function when ex->opline is NULL (#10003)

ex->opline can be null due to missing SAVE_OPLINE() in the VM

Fixes GH-9933


# cc9dddea 03-Nov-2022 Ilija Tovilo

Fix fake closure leaking when called from internal func

Introduced in 8e49d7f32f3bf8e20a699bfef5c2b2591a56e8ec.

ZEND_CALL_RELEASE_THIS was previously not handled for internal calls

Fix fake closure leaking when called from internal func

Introduced in 8e49d7f32f3bf8e20a699bfef5c2b2591a56e8ec.

ZEND_CALL_RELEASE_THIS was previously not handled for internal calls but
just for user calls in the zend_leave_helper.

Closes GH-9884

show more ...


# 1d6b32f6 21-Oct-2022 Ilija Tovilo

Remove unnecessary ast eval bailout

We can just reset the filename_override to NULL in php_request_shutdown.

Closes GH-9805


# 505e8d2a 12-Aug-2022 Jakub Zelenka

Fix GH-9310: SSL local_cert and local_pk do not respect open_basedir restriction


# 625f1649 20-Jul-2022 Bob Weinand

Include internal functions in the observer API

There are two main motivations to this:
a) The logic for handling internal and userland observation can be unified.
b) Unwinding of obs

Include internal functions in the observer API

There are two main motivations to this:
a) The logic for handling internal and userland observation can be unified.
b) Unwinding of observed functions on a bailout does notably not include observers. Even if users of observers were to ensure such handling themselves, it would be impossible to retain the relative ordering - either the user has to unwind all internal observed frames before the automatic unwinding (zend_observer_fcall_end_all) or afterwards, but not properly interleaved.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>

show more ...


# 6b160e78 28-Jul-2022 George Peter Banyard

Change fetch_type from int to uint32_t (#9152)

This is because it is derived from the opcode num which is an uint32_t


# af15923b 08-Jun-2022 Rowan Tommins

Extend deprecation notices to is_callable($foo) and callable $foo

Implements https://wiki.php.net/rfc/partially-supported-callables-expand-deprecation-notices
so that uses of "self" and

Extend deprecation notices to is_callable($foo) and callable $foo

Implements https://wiki.php.net/rfc/partially-supported-callables-expand-deprecation-notices
so that uses of "self" and "parent" in is_callable() and callable
type constraints now raise a deprecation notice, independent of the
one raised when and if the callable is actually invoked.

A new flag is added to the existing check_flags parameter of
zend_is_callable / zend_is_callable_ex, for use in internal calls
that would otherwise repeat the notice multiple times. In particular,
arguments to internal function calls are checked first based on
arginfo, and then again during ZPP, so the former suppresses the
deprecation notice.

Some existing tests which raised this deprecation have been updated
to avoid the syntax, but the existing version retained for maximum
regression coverage until it is made an error.

With thanks to Juliette Reinders Folmer for the RFC and initial
investigation.

Closes GH-8823.

show more ...


# d9e1871c 16-Jun-2022 Ilija Tovilo

Fix leak of backed_enum_table with preloading


# 280fd680 01-Jun-2022 Levi Morrison

Make vm_interrupt and timed_out atomic (#8327)

This is done by adding a new zend_atomic_bool type. The type
definition is only available for compiler alignment and size info; it
shou

Make vm_interrupt and timed_out atomic (#8327)

This is done by adding a new zend_atomic_bool type. The type
definition is only available for compiler alignment and size info; it
should be treated as opaque and only the zend_atomic_bool_* family of
functions should be used.

Note that directly using atomic_bool is complicated. All C++ compilers
stdlibs that I checked typedef atomic_bool to std::atomic<bool>, which
can't be used in an extern "C" section, and there's at least one usage
of this in core, and probably more outside of it.

So, instead use platform specific functions, preferring compiler
intrinsics.

show more ...


# 01d84545 31-May-2022 Sara Golemon

Verify internal types before abandoning call frame

An internal caller executing a builtin method with
a static return type will lose context if we drop
our frame before performing th

Verify internal types before abandoning call frame

An internal caller executing a builtin method with
a static return type will lose context if we drop
our frame before performing the validation.

show more ...


# 74924ada 03-May-2022 vajexal <72415539+vajexal@users.noreply.github.com>

Fix get_function_or_method_name when included file is scoped (#8467)


# b9e895bc 31-Mar-2022 Max Kellermann

Replace memcmp() with zend_string functions (#8216)

* ext/oci8: use zend_string_equals()

Eliminate duplicate code.

* main/php_variables: use zend_string_equals_literal()

Replace memcmp() with zend_string functions (#8216)

* ext/oci8: use zend_string_equals()

Eliminate duplicate code.

* main/php_variables: use zend_string_equals_literal()

Eliminate duplicate code.

* Zend/zend_string: add zend_string_equals_cstr()

Allows eliminating duplicate code.

* Zend, ext/{opcache,standard}, main/output: use zend_string_equals_cstr()

Eliminate duplicate code.

* Zend/zend_string: add zend_string_starts_with()

* ext/{opcache,phar,spl,standard}: use zend_string_starts_with()

This adds missing length checks to several callers, e.g. in
cache_script_in_shared_memory(). This is important when the
zend_string is shorter than the string parameter, when memcmp()
happens to check backwards; this can result in an out-of-bounds memory
access.

show more ...


# e3ef7bbb 05-Feb-2022 Ilija Tovilo

Adjust filename/lineno for constant expressions

Closes GH-7771
Closes GH-8124


# cbbf3502 07-Mar-2022 Bob Weinand

Fix GH-8176: Fix leaking enum values in property initializers


# 76548e50 17-Nov-2021 Dmitry Stogov

Fixed bug #81607 (CE_CACHE allocation with concurrent access)


# 812df2bd 12-Nov-2021 Cameron Porter

Fix bug #81611

Add zend_fetch_class_with_scope() which accepts a scope to use for
self/parent, and use that during constant expression evaluation.

Closes GH-7649.


# d9ff09a3 16-Nov-2021 Nikita Popov

Extract code for reporting a zend_fetch_class() error


# 90b7bde6 03-Nov-2021 Dmitry Stogov

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
(ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
(packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
- sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
- zend_hash_sort_ex() may require converting packed arrays to hash.

show more ...


# 70bd46cd 11-Oct-2021 Nikita Popov

Release trampoline on zend_call_function with active exception

zend_call_function() normally always releases a cached call
trampoline. Do this also if the call does not actually happen

Release trampoline on zend_call_function with active exception

zend_call_function() normally always releases a cached call
trampoline. Do this also if the call does not actually happen
due to an active exception, so the caller does not need to deal
with this very special case.

Fixes oss-fuzz #39792.

show more ...


# ac70bb36 01-Oct-2021 Nikita Popov

Don't populate CE_CACHE during compilation

It's possible for CE_CACHE slots to be populated during compilation
(e.g. due to an early binding attempt). When opcache then persists
the

Don't populate CE_CACHE during compilation

It's possible for CE_CACHE slots to be populated during compilation
(e.g. due to an early binding attempt). When opcache then persists
the class, it clears the CE_CACHE slot for the class name as declared,
but not for different spellings (that only differ in case). As such,
a pointer to the old, non-persistent class entry may be retained.

Fix this by not populating CE_CACHE if in_compilation is set.

Closes GH-7542.

show more ...


# 5bda4cd2 04-Sep-2021 codinghuang

Support specifying start position in compile_string

Add additional zend_compile_position argument, which can be either
AT_SHEBANG, AT_OPEN_TAG or AFTER_OPEN_TAG. The previous behavior

Support specifying start position in compile_string

Add additional zend_compile_position argument, which can be either
AT_SHEBANG, AT_OPEN_TAG or AFTER_OPEN_TAG. The previous behavior
corresponds to AFTER_OPEN_TAG.

Closes GH-7462.

show more ...


# 485d3acf 01-Sep-2021 Nikita Popov

Make zend_call_function() failure handling consistent

This API had rather peculiar behavior in case the provided function
is not callable. For some types of failures, it would silently

Make zend_call_function() failure handling consistent

This API had rather peculiar behavior in case the provided function
is not callable. For some types of failures, it would silently
return FAILURE (e.g. a function does not exist), while for others
(e.g. a class does not exist) it would generate a warning. Depending
on what the calling code does, this can either result in silent
failure or duplicate errors.

This commit switches the contract such that zend_call_function()
always (*) succeeds, though that success might be in the form of
throwing an exception. Calling a non-callable will now consistently
throw an exception.

There are some rare callers that do want to ignore missing methods,
for legacy APIs that are specific with optional methods. For these
use cases a new zend_call_method_if_exists() API is provided.

Calling code generally does not need to explicitly check for and
report zend_call_function() failures -- it can rely on
zend_call_function() having already done so. However, existing
code that does check for failure should continue to work fine.

(*) The only exception to this is if EG(active) being false during
late engine shutdown. This is not relevant to most code, but code
running in destructors and similar may need to be aware of the
possibility.

show more ...


# c7fdf9c1 01-Sep-2021 Dmitry Stogov

Avoid class name validation if it's already have IS_STR_CLASS_NAME_MAP_PTR flag.


# 3ec14000 01-Sep-2021 Nikita Popov

Remove UNDEF checks in userstream implementation

I don't see how object can be UNDEF here -- and just passing
NULL in that case is not going to do anything reasonable either.
It woul

Remove UNDEF checks in userstream implementation

I don't see how object can be UNDEF here -- and just passing
NULL in that case is not going to do anything reasonable either.
It would fall back to global functions with the same name.

show more ...


# cecea72a 16-Aug-2021 Nikita Popov

Reuse parts of normal executor shutdown for preloading

preloading currently reimplements parts of shutdown_executor(),
so it's easy for that code to go out of sync.

Extract this

Reuse parts of normal executor shutdown for preloading

preloading currently reimplements parts of shutdown_executor(),
so it's easy for that code to go out of sync.

Extract this into an zend_shutdown_executor_values() API function
and use it as part of the preloading pre-shutdown.

show more ...


12345678910>>...41