]> granicus.if.org Git - php/commitdiff
refine last patch. if the argument-stack is not consistent don't try to show
authorThies C. Arntzen <thies@php.net>
Mon, 2 Sep 2002 12:26:09 +0000 (12:26 +0000)
committerThies C. Arntzen <thies@php.net>
Mon, 2 Sep 2002 12:26:09 +0000 (12:26 +0000)
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.

Zend/zend_builtin_functions.c

index b507d8dea77be494493bf480d37986e5233df72b..2918dc068b8bf28c80122e7b5ff3d48450c98391 100644 (file)
@@ -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 */