Skip to content

Commit a439d9f

Browse files
committed
Call zend_generator_check_placeholder_frame() only for frames with
ZEND_CALL_GENERATOR flag
1 parent 7bd0b10 commit a439d9f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Zend/zend_builtin_functions.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,9 @@ ZEND_FUNCTION(debug_print_backtrace)
17091709
call_type = NULL;
17101710
ZVAL_UNDEF(&arg_array);
17111711

1712-
ptr = zend_generator_check_placeholder_frame(ptr);
1712+
if (UNEXPECTED((ZEND_CALL_INFO(call) & ZEND_CALL_GENERATOR) != 0)) {
1713+
ptr = zend_generator_check_placeholder_frame(ptr);
1714+
}
17131715

17141716
skip = ptr;
17151717
/* skip internal handler */
@@ -1911,7 +1913,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
19111913
stack_frame = zend_new_array(8);
19121914
zend_hash_real_init_mixed(stack_frame);
19131915

1914-
ptr = zend_generator_check_placeholder_frame(ptr);
1916+
if (UNEXPECTED((ZEND_CALL_INFO(call) & ZEND_CALL_GENERATOR) != 0)) {
1917+
ptr = zend_generator_check_placeholder_frame(ptr);
1918+
}
19151919

19161920
skip = ptr;
19171921
/* skip internal handler */

0 commit comments

Comments
 (0)