Skip to content

Commit 1077ea0

Browse files
committed
Inline zend_active_function()
1 parent 2837488 commit 1077ea0

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Zend/zend_execute.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,18 @@ ZEND_API const char *get_active_class_name(const char **space);
372372
ZEND_API const char *get_active_function_name(void);
373373
ZEND_API const char *get_active_function_arg_name(uint32_t arg_num);
374374
ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num);
375-
ZEND_API zend_function *zend_active_function(void);
376375
ZEND_API zend_function *zend_active_function_ex(zend_execute_data *execute_data);
376+
377+
static zend_always_inline zend_function *zend_active_function(void)
378+
{
379+
zend_function *func = EG(current_execute_data)->func;
380+
if (ZEND_USER_CODE(func->type)) {
381+
return zend_active_function_ex(EG(current_execute_data));
382+
} else {
383+
return func;
384+
}
385+
}
386+
377387
ZEND_API zend_string *get_active_function_or_method_name(void);
378388
ZEND_API zend_string *get_function_or_method_name(const zend_function *func);
379389
ZEND_API const char *zend_get_executed_filename(void);

Zend/zend_execute_API.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,6 @@ ZEND_API const char *get_active_function_name(void) /* {{{ */
559559
}
560560
/* }}} */
561561

562-
ZEND_API zend_function *zend_active_function(void)
563-
{
564-
return zend_active_function_ex(EG(current_execute_data));
565-
}
566-
567562
ZEND_API zend_function *zend_active_function_ex(zend_execute_data *execute_data)
568563
{
569564
ZEND_ASSERT(zend_is_executing());

0 commit comments

Comments
 (0)