]> granicus.if.org Git - php/commitdiff
Fixed wrong include/requre occurrences in debug backtrace.
authorDmitry Stogov <dmitry@php.net>
Mon, 27 Jun 2005 06:02:58 +0000 (06:02 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 27 Jun 2005 06:02:58 +0000 (06:02 +0000)
Zend/zend_builtin_functions.c

index 929f95f9f1fd1e7c8841b9a98db794220ee35d41..fd157c2323e64e71b4ff685db63a11fb823d2fce 100644 (file)
@@ -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;