From 97ec1ff4de6aec655c0d8f7cdf85a1dc92f32374 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 27 Jun 2005 06:02:58 +0000 Subject: [PATCH] Fixed wrong include/requre occurrences in debug backtrace. --- Zend/zend_builtin_functions.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.50.1