mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix backtraces with overridden zend_execute_ex
This commit is contained in:
parent
96ac919957
commit
018ddba9ae
2 changed files with 31 additions and 1 deletions
30
Zend/tests/bug_debug_backtrace_replace_zend_execute_ex.phpt
Normal file
30
Zend/tests/bug_debug_backtrace_replace_zend_execute_ex.phpt
Normal file
|
@ -0,0 +1,30 @@
|
|||
--TEST--
|
||||
bug_debug_backtrace.phpt with replaced zend_execute_ex
|
||||
--EXTENSIONS--
|
||||
zend_test
|
||||
--INI--
|
||||
zend_test.replace_zend_execute_ex=1
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
bar();
|
||||
}
|
||||
|
||||
function bar() {
|
||||
boo();
|
||||
}
|
||||
|
||||
function boo(){
|
||||
debug_print_backtrace();
|
||||
}
|
||||
|
||||
eval("foo();");
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 %s(%d): boo()
|
||||
#1 %s(%d): bar()
|
||||
#2 %s(%d) : eval()'d code(1): foo()
|
||||
#3 %s(%d): eval()
|
||||
Done
|
|
@ -1820,7 +1820,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
|||
zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &tmp);
|
||||
|
||||
skip_frame:
|
||||
if (UNEXPECTED((ZEND_CALL_INFO(call) & ZEND_CALL_TOP_FUNCTION) != 0)
|
||||
if (UNEXPECTED(ZEND_CALL_KIND(call) == ZEND_CALL_TOP_FUNCTION)
|
||||
&& !fake_frame
|
||||
&& prev
|
||||
&& prev->func
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue