mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix zend_fcc_equals() with trampolines (#10012)
We cannot compare the function handler pointer directly for trampolines, as they may be reallocated
This commit is contained in:
parent
9f0e4a55e7
commit
c4a0fc62a2
1 changed files with 8 additions and 0 deletions
|
@ -733,6 +733,14 @@ ZEND_API zend_result zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_
|
|||
/* Zend FCC API to store and handle PHP userland functions */
|
||||
static zend_always_inline bool zend_fcc_equals(const zend_fcall_info_cache* a, const zend_fcall_info_cache* b)
|
||||
{
|
||||
if (UNEXPECTED((a->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) &&
|
||||
(b->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE))) {
|
||||
return a->object == b->object
|
||||
&& a->calling_scope == b->calling_scope
|
||||
&& a->closure == b->closure
|
||||
&& zend_string_equals(a->function_handler->common.function_name, b->function_handler->common.function_name)
|
||||
;
|
||||
}
|
||||
return a->function_handler == b->function_handler
|
||||
&& a->object == b->object
|
||||
&& a->calling_scope == b->calling_scope
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue