logo       

cvs: ZendEngine2(PHP_5_0) / zend_builtin_functions.c /tests bug28377.phpt : msg#00166

Subject: cvs: ZendEngine2(PHP_5_0) / zend_builtin_functions.c /tests bug28377.phpt php-src NEWS
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




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe