Skip to content

Commit 815e2a9

Browse files
committed
update %C use config recall_depth
1 parent e4d8e6a commit 815e2a9

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/TemplateFormatter.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,45 @@ static smart_str* get_class_and_action(smart_str *result TSRMLS_DC)
4444
{
4545
char *func;
4646
char *cls;
47+
int recall_depth = SEASLOG_G(recall_depth);
4748
zend_execute_data *execute_data = EG(current_execute_data);
4849

4950
if (!execute_data || !(execute_data = execute_data->prev_execute_data))
5051
{
5152
return NULL;
5253
}
5354

55+
#if PHP_VERSION_ID >= 70000
56+
57+
while(recall_depth > 0)
58+
{
59+
if (execute_data->prev_execute_data != NULL && execute_data->prev_execute_data->func &&
60+
ZEND_USER_CODE(execute_data->prev_execute_data->func->common.type)
61+
)
62+
{
63+
execute_data = execute_data->prev_execute_data;
64+
}
65+
else
66+
{
67+
break;
68+
}
69+
recall_depth--;
70+
}
71+
#else
72+
while(recall_depth > 0)
73+
{
74+
if (execute_data->prev_execute_data && execute_data->prev_execute_data->opline)
75+
{
76+
execute_data = execute_data->prev_execute_data;
77+
}
78+
else
79+
{
80+
break;
81+
}
82+
recall_depth--;
83+
}
84+
#endif
85+
5486
func = seaslog_performance_get_function_name(execute_data TSRMLS_CC);
5587
if (!func)
5688
{

0 commit comments

Comments
 (0)