From: Dmitry Stogov Date: Mon, 27 Jun 2005 06:02:58 +0000 (+0000) Subject: Fixed wrong include/requre occurrences in debug backtrace. X-Git-Tag: php-5.0.5RC1~124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97ec1ff4de6aec655c0d8f7cdf85a1dc92f32374;p=php Fixed wrong include/requre occurrences in debug backtrace. --- diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 929f95f9f1..fd157c2323 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1667,6 +1667,11 @@ ZEND_FUNCTION(debug_print_backtrace) /* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */ zend_bool build_filename_arg = 1; + if (!ptr->opline || ptr->opline->opcode != ZEND_INCLUDE_OR_EVAL) { + /* can happen when calling eval from a custom sapi */ + function_name = "unknown"; + build_filename_arg = 0; + } else switch (ptr->opline->op2.u.constant.value.lval) { case ZEND_EVAL: function_name = "eval"; @@ -1838,7 +1843,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML /* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */ zend_bool build_filename_arg = 1; - if (!ptr->opline) { + if (!ptr->opline || ptr->opline->opcode != ZEND_INCLUDE_OR_EVAL) { /* can happen when calling eval from a custom sapi */ function_name = "unknown"; build_filename_arg = 0;