overloaded (__get)). (Dmitry)
- Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden
methods). (Dmitry)
+- Fixed bug #28377 (debug_backtrace is intermittently passing args). (Dmitry)
- Fixed bug #27268 (Bad references accentuated by clone). (Dmitry)
22 Jun 2005, PHP 5.1 Beta 2
--- /dev/null
+--TEST--
+Bug #28377 (debug_backtrace is intermittently passing args)
+--FILE--
+<?php
+function doit($a, $b)
+{
+ $trace = debug_backtrace();
+ custom_callback('dereferenced', $trace);
+ custom_callback('direct', debug_backtrace());
+}
+
+function custom_callback($traceName, $btInfo)
+{
+ echo $traceName ." -- args: ";
+ echo isset($btInfo[0]['args']) ? count($btInfo[0]['args']) : 'does not exist';
+ echo "\n";
+}
+
+doit('a','b');
+?>
+--EXPECT--
+dereferenced -- args: 2
+direct -- args: 2
(*arg)->refcount++;
add_next_index_zval(arg_array, *arg);
}
+
+ /* skip args from incomplete frames */
+ while ((((*curpos)-1) > EG(argument_stack).elements) && *((*curpos)-1)) {
+ (*curpos)--;
+ }
+
return arg_array;
}
args -= *(ulong*)args;
frames_on_stack++;
+ /* skip args from incomplete frames */
+ while (((args-1) > EG(argument_stack).elements) && *(args-1)) {
+ args--;
+ }
+
if ((args-1) == EG(argument_stack).elements) {
arg_stack_consistent = 1;
break;
cur_arg_pos -= 2;
frames_on_stack--;
+ if (arg_stack_consistent) {
+ /* skip args from incomplete frames */
+ while (((cur_arg_pos-1) > EG(argument_stack).elements) && *(cur_arg_pos-1)) {
+ cur_arg_pos--;
+ }
+ }
+
array_init(return_value);
while (ptr) {
args -= *(ulong*)args;
frames_on_stack++;
+ /* skip args from incomplete frames */
+ while (((args-1) > EG(argument_stack).elements) && *(args-1)) {
+ args--;
+ }
+
if ((args-1) == EG(argument_stack).elements) {
arg_stack_consistent = 1;
break;
cur_arg_pos -= (arg_count + 2);
frames_on_stack--;
ptr = ptr->prev_execute_data;
+
+ if (arg_stack_consistent) {
+ /* skip args from incomplete frames */
+ while (((cur_arg_pos-1) > EG(argument_stack).elements) && *(cur_arg_pos-1)) {
+ cur_arg_pos--;
+ }
+ }
}
array_init(return_value);