Skip to content

Commit c307b55

Browse files
committed
Avoid allocating temporaries on the call frame for property hook trampolines
As pointed out in php#16252 (comment)
1 parent 1e6e7bf commit c307b55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_object_handlers.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,9 @@ ZEND_API zend_function *zend_get_property_hook_trampoline(
17071707
func = (zend_function *)(uintptr_t)ecalloc(1, sizeof(zend_internal_function));
17081708
}
17091709
func->type = ZEND_INTERNAL_FUNCTION;
1710+
/* This trampoline does not use the call_trampoline_op, so it won't reuse the call frame,
1711+
* which means we don't even need to reserve a temporary for observers. */
1712+
func->common.T = 0;
17101713
func->common.arg_flags[0] = 0;
17111714
func->common.arg_flags[1] = 0;
17121715
func->common.arg_flags[2] = 0;

0 commit comments

Comments
 (0)