From: Thies C. Arntzen Date: Mon, 2 Sep 2002 12:26:09 +0000 (+0000) Subject: refine last patch. if the argument-stack is not consistent don't try to show X-Git-Tag: RELEASE_0_91~160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96ab23981ccb6bb84fe9daeac143768a7a502f2f;p=php refine last patch. if the argument-stack is not consistent don't try to show arguments. no call to zend_error is made as we might end up in an infinite recursion if called from an error_handler. so: if the arguments to functions aren't shown in debug_backtrace this is 'cause the arument stack was not consistent when debug_backtrace was called. --- diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index b507d8dea7..2918dc068b 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1299,10 +1299,6 @@ ZEND_FUNCTION(debug_backtrace) } } - if (! arg_stack_consitent) { - zend_error(E_ERROR, "debug_backtrace(): Can't be called by function parameter"); - } - ptr = EG(current_execute_data); /* skip debug_backtrace() */ @@ -1350,7 +1346,9 @@ ZEND_FUNCTION(debug_backtrace) } if ((! ptr->opline) || ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL))) { - add_assoc_zval_ex(stack_frame, "args", sizeof("args"), debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC)); + if (arg_stack_consitent) { + add_assoc_zval_ex(stack_frame, "args", sizeof("args"), debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC)); + } } } else { /* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */