Skip to content

Commit eef3e66

Browse files
author
Thies C. Arntzen
committed
debug_backtrace()
- make args passed to functions called vy call_user_function available again.
1 parent 7f62a0c commit eef3e66

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,8 +1280,6 @@ ZEND_FUNCTION(debug_backtrace)
12801280
char *include_filename = NULL;
12811281
zval *stack_frame;
12821282
void **cur_arg_pos = EG(argument_stack).top_element;
1283-
int get_args;
1284-
12851283

12861284
if (ZEND_NUM_ARGS()) {
12871285
WRONG_PARAM_COUNT;
@@ -1312,11 +1310,6 @@ ZEND_FUNCTION(debug_backtrace)
13121310
/* try to fetch args only if an FCALL was just made - elsewise we're in the middle of a function
13131311
* and debug_baktrace() might have been called by the error_handler. in this case we don't
13141312
* want to pop anything of the argument-stack */
1315-
if ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL)) {
1316-
get_args = 1;
1317-
} else {
1318-
get_args = 0;
1319-
}
13201313
} else {
13211314
filename = NULL;
13221315
}
@@ -1342,7 +1335,7 @@ ZEND_FUNCTION(debug_backtrace)
13421335
add_assoc_string_ex(stack_frame, "type", sizeof("type"), call_type, 1);
13431336
}
13441337

1345-
if (get_args) {
1338+
if ((! ptr->opline) || ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL))) {
13461339
add_assoc_zval_ex(stack_frame, "args", sizeof("args"), debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC));
13471340
}
13481341
} else {

Zend/zend_execute_API.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun
477477
EX(object) = NULL;
478478
EX(Ts) = NULL;
479479
EX(op_array) = NULL;
480+
EX(opline) = NULL;
480481
*retval_ptr_ptr = NULL;
481482

482483
if (function_name->type==IS_ARRAY) { /* assume array($obj, $name) couple */

0 commit comments

Comments
 (0)