dmitry Thu Jun 23 07:59:58 2005 EDT
Added files: (Branch: PHP_5_0)
/ZendEngine2/tests bug28377.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_builtin_functions.c
Log:
Fixed bug #28377 (debug_backtrace is intermittently passing args)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.441&r2=1.1760.2.442&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.441 php-src/NEWS:1.1760.2.442
--- php-src/NEWS:1.1760.2.441 Thu Jun 23 07:04:54 2005
+++ php-src/NEWS Thu Jun 23 07:59:55 2005
@@ -175,6 +175,7 @@
- Fixed bug #28839 (SIGSEGV in interactive mode (php -a)).
(kameshj at fastmail dot fm)
- Fixed bug #28605 (Need to use -[m]ieee option for Alpha CPUs). (Jani)
+- Fixed bug #28377 (debug_backtrace is intermittently passing args). (Dmitry)
- Fixed bug #27598 (list() array key assignment causes HUGE memory leak).
(Dmitry)
- Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when
http://cvs.php.net/diff.php/ZendEngine2/zend_builtin_functions.c?r1=1.239.2.24&r2=1.239.2.25&ty=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.239.2.24
ZendEngine2/zend_builtin_functions.c:1.239.2.25
--- ZendEngine2/zend_builtin_functions.c:1.239.2.24 Thu Jun 23 05:23:03 2005
+++ ZendEngine2/zend_builtin_functions.c Thu Jun 23 07:59:56 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.c,v 1.239.2.24 2005/06/23 09:23:03 dmitry Exp $
*/
+/* $Id: zend_builtin_functions.c,v 1.239.2.25 2005/06/23 11:59:56 dmitry Exp $
*/
#include "zend.h"
#include "zend_API.h"
@@ -1529,6 +1529,12 @@
(*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;
}
@@ -1576,6 +1582,11 @@
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;
@@ -1589,6 +1600,13 @@
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) {
@@ -1724,6 +1742,11 @@
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;
@@ -1743,6 +1766,13 @@
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);
http://cvs.php.net/co.php/ZendEngine2/tests/bug28377.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug28377.phpt
+++ ZendEngine2/tests/bug28377.phpt
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|