Skip to content

Zend: always populate error pointer on failure of zend_is_callable() - #24435

Merged
Girgias merged 4 commits into
php:masterfrom
Girgias:2026-10-zend_is_callable_always_produce_error
Oct 20, 2026
Merged

Girgias merged 4 commits into
php:masterfrom
Girgias:2026-10-zend_is_callable_always_produce_error

Conversation

@Girgias

@Girgias Girgias commented Oct 19, 2026

Copy link
Copy Markdown
Member

Most of the code base expects an error to be set if a char* is provided, as this used to be always the case. It no longer was the case since the partially supported callables were deprecates as the deprecation could be promoted to an exception in which case we skipped allocating a char*.

The simple fix, allocate a char* even in case of an exception so callers don't need to check if it still NULL. This fixes some error messages at the same time.

Was hitting this again in #23105.

@arnaud-lb arnaud-lb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Comment thread Zend/zend_API.c Outdated
Co-authored-by: Arnaud Le Blanc <365207+arnaud-lb@users.noreply.github.com>
@Girgias
Girgias merged commit 2f7b01b into php:master Oct 20, 2026
1 of 2 checks passed
@Girgias
Girgias deleted the 2026-10-zend_is_callable_always_produce_error branch October 20, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants