From fc37a8262b5a2ad7908fee3457fa11d41d4671cb Mon Sep 17 00:00:00 2001 From: twosee Date: Thu, 29 Sep 2022 22:17:17 +0800 Subject: [PATCH] Fix debug backtrace frameno (#8761) --- Zend/zend_builtin_functions.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 8813fa9788a..a762240abe3 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1737,8 +1737,6 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int prev = zend_generator_check_placeholder_frame(prev); } - frameno++; - /* We use _zend_hash_append*() and the array must be preallocated */ stack_frame = zend_new_array(8); zend_hash_real_init_mixed(stack_frame); @@ -1882,6 +1880,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int ZVAL_ARR(&tmp, stack_frame); zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &tmp); + frameno++; skip_frame: if (UNEXPECTED(ZEND_CALL_KIND(call) == ZEND_CALL_TOP_FUNCTION)